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