Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
813ff7fd
Commit
813ff7fd
authored
Jul 28, 2015
by
antirez
Browse files
Avoid magic "0" argument to prepareForShutdown().
Backported from Disque.
parent
5cfb7927
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
813ff7fd
...
@@ -1125,7 +1125,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
...
@@ -1125,7 +1125,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
/* We received a SIGTERM, shutting down here in a safe way, as it is
/* We received a SIGTERM, shutting down here in a safe way, as it is
* not ok doing so inside the signal handler. */
* not ok doing so inside the signal handler. */
if
(
server
.
shutdown_asap
)
{
if
(
server
.
shutdown_asap
)
{
if
(
prepareForShutdown
(
0
)
==
C_OK
)
exit
(
0
);
if
(
prepareForShutdown
(
SHUTDOWN_NOFLAGS
)
==
C_OK
)
exit
(
0
);
serverLog
(
LL_WARNING
,
"SIGTERM received but errors trying to shut down the server, check the logs for more information"
);
serverLog
(
LL_WARNING
,
"SIGTERM received but errors trying to shut down the server, check the logs for more information"
);
server
.
shutdown_asap
=
0
;
server
.
shutdown_asap
=
0
;
}
}
...
...
src/server.h
View file @
813ff7fd
...
@@ -368,9 +368,10 @@ typedef long long mstime_t; /* millisecond time type. */
...
@@ -368,9 +368,10 @@ typedef long long mstime_t; /* millisecond time type. */
#define UNIT_MILLISECONDS 1
#define UNIT_MILLISECONDS 1
/* SHUTDOWN flags */
/* SHUTDOWN flags */
#define SHUTDOWN_SAVE 1
/* Force SAVE on SHUTDOWN even if no save
#define SHUTDOWN_NOFLAGS 0
/* No flags. */
points are configured. */
#define SHUTDOWN_SAVE 1
/* Force SAVE on SHUTDOWN even if no save
#define SHUTDOWN_NOSAVE 2
/* Don't SAVE on SHUTDOWN. */
points are configured. */
#define SHUTDOWN_NOSAVE 2
/* Don't SAVE on SHUTDOWN. */
/* Command call flags, see call() function */
/* Command call flags, see call() function */
#define CMD_CALL_NONE 0
#define CMD_CALL_NONE 0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment