static void zremrangebyscoreCommand(redisClient *c);
static void multiCommand(redisClient *c);
static void execCommand(redisClient *c);
+static void aofsyncCommand(redisClient *c);
/*================================= Globals ================================= */
{"save",saveCommand,1,REDIS_CMD_INLINE},
{"bgsave",bgsaveCommand,1,REDIS_CMD_INLINE},
{"bgrewriteaof",bgrewriteaofCommand,1,REDIS_CMD_INLINE},
+ {"aofsync",aofsyncCommand,1,REDIS_CMD_INLINE},
{"shutdown",shutdownCommand,1,REDIS_CMD_INLINE},
{"lastsave",lastsaveCommand,1,REDIS_CMD_INLINE},
{"type",typeCommand,2,REDIS_CMD_INLINE},
}
}
+static void aofsyncCommand(redisClient *c) {
+ if (server.appendonly)
+ fsync(server.appendfd);
+ else
+ addReplySds(c,sdsnew("-ERR Append Only File is not active\r\n"));
+}
+
static void aofRemoveTempFile(pid_t childpid) {
char tmpfile[256];