Fix crash-loop: CronTrigger resolves its own timezone independent of the scheduler's
All checks were successful
Deploy / deploy (push) Successful in 22s

The America/Phoenix TZ fix earlier only passed timezone= to
BackgroundScheduler's constructor. That wasn't enough: APScheduler's
CronTrigger independently calls tzlocal's get_localzone() in its own
__init__ when not given an explicit timezone, regardless of what the
scheduler itself is configured with. This never surfaced in testing
because schedules.json was always empty — the rebuild_jobs() loop that
constructs CronTrigger never executed. It crashed for real once a real
schedule existed (confirmed live: the already-configured "Pokemon
Singles >10" 4x/day schedule crash-looped the container on every boot).
Fixed by passing the same resolved timezone to every CronTrigger call.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H6TgffxTvYhqxykAbVQg2v
This commit is contained in:
Barely Removable 2026-08-31 20:25:25 -07:00
parent 3b08af7938
commit 0f336b3d0c
2 changed files with 15 additions and 7 deletions

2
app.py
View file

@ -8,7 +8,7 @@ import automation
import scheduler
import storage
APP_VERSION = "0.4.0"
APP_VERSION = "0.4.1"
APP_VERSION_DATE = "2026-09-01"
app = Flask(__name__)