Close the listening sockets. Apparently this allows faster restarts.

This commit is contained in:
antirez
2011-07-22 12:12:45 +02:00
parent 8b58723eb2
commit 6c68df4f32
+4
View File
@@ -1157,6 +1157,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;
}