Close the listening sockets. Apparently this allows faster restarts.

This commit is contained in:
antirez 2011-07-22 12:11:40 +02:00
parent adae85cdae
commit 80e87a461a
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}