diff options
author | antirez <antirez@gmail.com> | 2011-07-22 12:11:40 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-07-22 12:12:55 +0200 |
commit | ec7bbadce925322f29346b692a0b5ac337560bba (patch) | |
tree | a46e3ad8ca216c741b8f98862db2e27c139f10c1 | |
parent | 063923de1cd3deb4d18cb2fda9bafa7101ac92c2 (diff) | |
download | redis-ec7bbadce925322f29346b692a0b5ac337560bba.tar.gz |
Close the listening sockets. Apparently this allows faster restarts.
-rw-r--r-- | src/redis.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/redis.c b/src/redis.c index 2d3f0403d..1d732e91f 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1118,6 +1118,10 @@ int prepareForShutdown() { redisLog(REDIS_NOTICE,"Removing the pid file."); unlink(server.pidfile); } + /* Close the listening sockets. Apparently this allows faster restarts. */ + if (server.ipfd != -1) close(server.ipfd); + if (server.sofd != -1) close(server.sofd); + redisLog(REDIS_WARNING,"Redis is now ready to exit, bye bye..."); return REDIS_OK; } |