Avoid spurious wakeup on deleted timer event (#11069)

Avoid spurious wakeup on deleted timer event

Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
This commit is contained in:
Tian 2022-11-26 12:36:33 +08:00 committed by GitHub
parent 25ffa79b64
commit 7be86177a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ static int64_t usUntilEarliestTimer(aeEventLoop *eventLoop) {
aeTimeEvent *earliest = NULL;
while (te) {
if (!earliest || te->when < earliest->when)
if ((!earliest || te->when < earliest->when) && te->id != AE_DELETED_EVENT_ID)
earliest = te;
te = te->next;
}