diff --git a/src/queue.c b/src/queue.c index bc3216ba..814a38b3 100644 --- a/src/queue.c +++ b/src/queue.c @@ -490,20 +490,17 @@ void HandleQueuedReminders(void) /* Calculate the next trigger time */ q->tt.nexttime = CalculateNextTime(q); - /* If it's dequeued, update num_queued */ if (q->tt.nexttime != NO_TIME) { /* If trigger time is way in the past because computer has been suspended or hibernated, remove from queue */ if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes && q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) { - q->tt.nexttime = NO_TIME; + del_reminder((unsigned long) q); + if (IsServerMode()) { + print_num_queued(); + } } } - - /* If we have dequeued a reminder, update controlling process */ - if (q->tt.nexttime == NO_TIME && IsServerMode()) { - print_num_queued(); - } } exit(EXIT_SUCCESS); }