From d5059ba5e15c42def95c4c5054cdd8a91ed11efc Mon Sep 17 00:00:00 2001 From: tzongw Date: Wed, 11 Nov 2020 18:10:54 +0800 Subject: [PATCH] Invalidate aeTimer when returning AE_NOMORE (#8022) --- src/module.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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