summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortzongw <tzongw@users.noreply.github.com>2020-11-11 18:10:54 +0800
committerGitHub <noreply@github.com>2020-11-11 12:10:54 +0200
commitd5059ba5e15c42def95c4c5054cdd8a91ed11efc (patch)
tree59e5f3b4b0629cb88c9e7ceb7408c71eaf8636c6 /src
parentdd1f20edc5ecda7848c31601782c5e9d7bce4788 (diff)
downloadredis-d5059ba5e15c42def95c4c5054cdd8a91ed11efc.tar.gz
Invalidate aeTimer when returning AE_NOMORE (#8022)
Diffstat (limited to 'src')
-rw-r--r--src/module.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/module.c b/src/module.c
index b4a15acae..691a9d298 100644
--- a/src/module.c
+++ b/src/module.c
@@ -5453,7 +5453,12 @@ int moduleTimerHandler(struct aeEventLoop *eventLoop, long long id, void *client
/* Reschedule the next timer or cancel it. */
if (next_period <= 0) next_period = 1;
- return (raxSize(Timers) > 0) ? next_period : AE_NOMORE;
+ if (raxSize(Timers) > 0) {
+ return next_period;
+ } else {
+ aeTimer = -1;
+ return AE_NOMORE;
+ }
}
/* Create a new timer that will fire after `period` milliseconds, and will call