Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0150db36
Commit
0150db36
authored
May 19, 2009
by
Aman Gupta
Browse files
Allow timeout=0 config to disable client timeouts
parent
83cdfe18
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
0150db36
...
...
@@ -720,7 +720,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
}
/* Close connections of timedout clients */
if
(
!
(
loops
%
10
))
if
(
server
.
maxidletime
&&
!
(
loops
%
10
))
closeTimedoutClients
();
/* Check if a background saving in progress terminated */
...
...
@@ -959,7 +959,7 @@ static void loadServerConfig(char *filename) {
/* Execute config directives */
if
(
!
strcasecmp
(
argv
[
0
],
"timeout"
)
&&
argc
==
2
)
{
server
.
maxidletime
=
atoi
(
argv
[
1
]);
if
(
server
.
maxidletime
<
1
)
{
if
(
server
.
maxidletime
<
0
)
{
err
=
"Invalid timeout value"
;
goto
loaderr
;
}
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"port"
)
&&
argc
==
2
)
{
...
...
redis.conf
View file @
0150db36
...
...
@@ -16,7 +16,7 @@ port 6379
#
# bind 127.0.0.1
# Close the connection after a client is idle for N seconds
# Close the connection after a client is idle for N seconds
(0 to disable)
timeout
300
# Save the DB on disk:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment