Scheduled Heroku Scheduler jobs execute at unexpected times after changing app region
0 reputation · 28 Jun 2023, 05:48 UTC
Developers expect Heroku Scheduler to trigger jobs according to a local time zone that matches the application’s intended audience, especially after moving the app to a different geographic region. The platform does not automatically adjust the scheduler’s execution time based on the dyno’s region, leaving the timing dependent on the TZ configuration variable.
Because the TZ var must be set explicitly and only takes effect after a dyno restart, any change in region or desired local time requires manual coordination. Add‑ons such as Heroku Postgres continue to store timestamps in UTC, so the application must still perform zone conversion for display purposes. This creates a gap between the configured region and the actual runtime behavior of scheduled tasks.
What is the recommended workflow for updating the TZ variable when an app is migrated to a new Heroku region without causing missed or duplicate Scheduler runs?
How can teams verify that Scheduler jobs are honoring the new TZ setting after a dyno restart without introducing additional logging or metric overhead?