From: antirez Date: Fri, 22 Jul 2011 10:11:40 +0000 (+0200) Subject: Close the listening sockets. Apparently this allows faster restarts. X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/80e87a461a7d2ee54430127bdb6ac014778c54c5 Close the listening sockets. Apparently this allows faster restarts. --- diff --git a/src/redis.c b/src/redis.c index 4e2f73a7..0bedc25b 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1190,6 +1190,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; }