Short answer: Use a small cron trigger to enqueue bounded reservation ID batches, then let an idempotent PostgreSQL worker conditionally delete only holds that remain expired; a duplicate queue delivery should be a harmless no-op.
That is the whole rule.
The incident lesson: delivery is a hint, not proof
I've been paged for both sides of scheduling failure: missed jobs and duplicate deliveries. They look opposed, but they expose the same bad assumption. A team treated one cron invocation and one queue message as proof that one unit of work would happen exactly once. The runbook then had nowhere useful to go. Replaying the trigger risked deleting twice, while refusing to replay left stale state behind.
For an edtech reservation system, the boundary is precise. A learner gets a temporary seat hold. Once its fixed hold window ends, cleanup may expire that reservation, but it must not touch a renewed or confirmed reservation.…