From 6586fae3eb3ebe9947d9f9041cdd64ef930128cf Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sat, 16 Mar 2024 13:36:24 -0400 Subject: [PATCH] Fix logic bug that would sometimes fail to send a queue update message to controlling process. --- src/queue.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/queue.c b/src/queue.c index 814a38b3..14aa7ecd 100644 --- a/src/queue.c +++ b/src/queue.c @@ -495,10 +495,16 @@ void HandleQueuedReminders(void) suspended or hibernated, remove from queue */ if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes && q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) { - del_reminder((unsigned long) q); - if (IsServerMode()) { - print_num_queued(); - } + q->tt.nexttime = NO_TIME; + } + } + + /* If queued reminder has expired, actually remove it from queue + and update status */ + if (q->tt.nexttime == NO_TIME) { + del_reminder((unsigned long) q); + if (IsServerMode()) { + print_num_queued(); } } }