mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 06:48:47 +02:00
Actually de-queue and free reminders that expire out of the queue.
This commit is contained in:
11
src/queue.c
11
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user