RecurringTicketModel::updateAfterRun() is dead code lacking the double-fire race guard of the method that replaced it #90

Open
opened 2026-09-01 00:08:19 -04:00 by jared · 0 comments
Owner

Severity: Low

models/RecurringTicketModel.php::updateAfterRun() has zero callers anywhere in the codebase — superseded by the atomic claimForRun(), which the cron script actually uses. Harmless as dead code, but it lacks claimForRun's WHERE ... AND next_run_at <= NOW() conditional-claim guard that prevents the double-fire race between concurrent cron invocations. If anyone reuses updateAfterRun() later assuming it's equivalent/interchangeable with claimForRun(), they'd silently reintroduce that race.

Fix: Delete updateAfterRun() to remove the trap for future maintainers.

**Severity:** Low `models/RecurringTicketModel.php::updateAfterRun()` has zero callers anywhere in the codebase — superseded by the atomic `claimForRun()`, which the cron script actually uses. Harmless as dead code, but it lacks `claimForRun`'s `WHERE ... AND next_run_at <= NOW()` conditional-claim guard that prevents the double-fire race between concurrent cron invocations. If anyone reuses `updateAfterRun()` later assuming it's equivalent/interchangeable with `claimForRun()`, they'd silently reintroduce that race. **Fix:** Delete `updateAfterRun()` to remove the trap for future maintainers.
jared added the dead-codepriority/low labels 2026-09-08 10:15:49 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#90