Permalink
Browse files

Close the listening sockets. Apparently this allows faster restarts.

  • Loading branch information...
1 parent 063923d commit ec7bbadce925322f29346b692a0b5ac337560bba @antirez committed Jul 22, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/redis.c
View
@@ -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;
}

0 comments on commit ec7bbad

Please sign in to comment.