Skip to content

Commit

Permalink
Fix the case where modules call commands in cron.
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Tianjie <[email protected]>
  • Loading branch information
CharlesChen888 committed Apr 30, 2024
1 parent 85773e6 commit e48fea8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -3717,7 +3717,11 @@ void call(client *c, int flags) {
}

if (!(c->flags & CLIENT_BLOCKED)) {
server.current_client->commands_processed++;
/* Modules may call commands in cron, in which case server.current_client
* is not set. */
if (server.current_client) {
server.current_client->commands_processed++;
}
server.stat_numcommands++;
}

Expand Down

0 comments on commit e48fea8

Please sign in to comment.