Skip to content

Commit

Permalink
Close the listening sockets. Apparently this allows faster restarts.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jul 22, 2011
1 parent 8b58723 commit 6c68df4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/redis.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c68df4

Please sign in to comment.