Skip to content

Commit

Permalink
Take into account lazyfree_lazy_user_flush
Browse files Browse the repository at this point in the history
  • Loading branch information
moticless committed Sep 26, 2024
1 parent e0b1b07 commit 8a00798
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ void replySlotsFlushAndFree(client *c, SlotsFlush *sflush) {
* optimization.
*/
void sflushCommand(client *c) {
int flags = EMPTYDB_NO_FLAGS, argc = c->argc;
int flags, argc = c->argc;

if (server.cluster_enabled == 0) {
addReplyError(c,"This instance has cluster support disabled");
Expand All @@ -1590,10 +1590,13 @@ void sflushCommand(client *c) {

/* check if last argument is SYNC or ASYNC */
if (!strcasecmp(c->argv[c->argc-1]->ptr,"sync")) {
flags = EMPTYDB_NO_FLAGS;
argc--;
} else if (!strcasecmp(c->argv[c->argc-1]->ptr,"async")) {
flags |= EMPTYDB_ASYNC;
flags = EMPTYDB_ASYNC;
argc--;
} else if (server.lazyfree_lazy_user_flush) {
flags = EMPTYDB_ASYNC;
}

/* parse the slot range */
Expand Down

0 comments on commit 8a00798

Please sign in to comment.