mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
parent
dffebbc904
commit
f80cf7363a
@ -1472,15 +1472,19 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
|
||||
* On failure the function logs a warning on the Redis log. */
|
||||
void sentinelFlushConfig(void) {
|
||||
int fd;
|
||||
int saved_hz = server.hz;
|
||||
|
||||
if (rewriteConfig(server.configfile) == -1) {
|
||||
server.hz = REDIS_DEFAULT_HZ;
|
||||
if (rewriteConfig(server.configfile) != -1) {
|
||||
/* Rewrite succeded, fsync it. */
|
||||
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
|
||||
fsync(fd);
|
||||
close(fd);
|
||||
}
|
||||
} else {
|
||||
redisLog(REDIS_WARNING,"WARNING: Senitnel was not able to save the new configuration on disk!!!: %s", strerror(errno));
|
||||
return;
|
||||
}
|
||||
if ((fd = open(server.configfile,O_RDONLY)) != -1) {
|
||||
fsync(fd);
|
||||
close(fd);
|
||||
}
|
||||
server.hz = saved_hz;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user