Fixes a bug where the wrapper, on service restart, would fire one catch-up backup per minute for each daily-times slot that had already passed today. With a schedule like 00:00,04:00,08:00,12:00,16:00,20:00 and a restart at 19:00, this meant 5 near-identical full-world zips at 1-minute intervals.
Source comment already documented the intended behaviour but the code didnt implement it. Fixed in Start() by pre-populating _firedToday with all times <= now.
Tested live on glados. New binary deployed. Switched schedule to clock-aligned 00:00,04:00,08:00,12:00,16:00,20:00 after deploy: zero catch-up backups fired in the 90s window after restart (vs 5+ before the fix).
Fixes a bug where the wrapper, on service restart, would fire one catch-up backup per minute for each daily-times slot that had already passed today. With a schedule like `00:00,04:00,08:00,12:00,16:00,20:00` and a restart at 19:00, this meant 5 near-identical full-world zips at 1-minute intervals.
Source comment already documented the intended behaviour but the code didnt implement it. Fixed in `Start()` by pre-populating `_firedToday` with all times <= now.
Tested live on glados. New binary deployed. Switched schedule to clock-aligned `00:00,04:00,08:00,12:00,16:00,20:00` after deploy: zero catch-up backups fired in the 90s window after restart (vs 5+ before the fix).
The wake loop's daily-times branch was firing one missed slot per minute
on service restart. With a schedule like "00:00,04:00,08:00,12:00,16:00,
20:00" and a restart at 19:00, the wrapper would catch up by firing 5
backups at 1-minute intervals -- each a full-world zip of the same
in-memory world. Pure waste: the live world hasn't diverged across the
missed clock slots, the snapshots would be near-identical, and the rapid
save-off/save-on churn impacts player experience.
Source comment already documented the intended behaviour ("Doesn't catch
up if the server was off when a slot passed -- daily/interval backups
don't need replay logic.") but the code didn't implement it.
Fix: in Start(), pre-populate _firedToday with all times <= now so the
wake loop only fires future slots for the rest of today.
Tested live on glados: switched schedule to clock-aligned daily-times
after deploying the fix, zero catch-up backups fired in the 90s window
after restart (vs 5+ before the fix).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matt
merged commit a8ff660114 into main2026-05-28 13:52:58 +00:00
Matt
deleted branch fix/backup-scheduler-no-replay2026-05-28 13:52:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes a bug where the wrapper, on service restart, would fire one catch-up backup per minute for each daily-times slot that had already passed today. With a schedule like
00:00,04:00,08:00,12:00,16:00,20:00and a restart at 19:00, this meant 5 near-identical full-world zips at 1-minute intervals.Source comment already documented the intended behaviour but the code didnt implement it. Fixed in
Start()by pre-populating_firedTodaywith all times <= now.Tested live on glados. New binary deployed. Switched schedule to clock-aligned
00:00,04:00,08:00,12:00,16:00,20:00after deploy: zero catch-up backups fired in the 90s window after restart (vs 5+ before the fix).The wake loop's daily-times branch was firing one missed slot per minute on service restart. With a schedule like "00:00,04:00,08:00,12:00,16:00, 20:00" and a restart at 19:00, the wrapper would catch up by firing 5 backups at 1-minute intervals -- each a full-world zip of the same in-memory world. Pure waste: the live world hasn't diverged across the missed clock slots, the snapshots would be near-identical, and the rapid save-off/save-on churn impacts player experience. Source comment already documented the intended behaviour ("Doesn't catch up if the server was off when a slot passed -- daily/interval backups don't need replay logic.") but the code didn't implement it. Fix: in Start(), pre-populate _firedToday with all times <= now so the wake loop only fires future slots for the rest of today. Tested live on glados: switched schedule to clock-aligned daily-times after deploying the fix, zero catch-up backups fired in the 90s window after restart (vs 5+ before the fix). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>