提交 0150db36 编写于 作者: A Aman Gupta

Allow timeout=0 config to disable client timeouts

上级 83cdfe18
......@@ -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) {
......
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册