Skip to content

Respect configured cron timezone#127

Open
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/cron-timezone
Open

Respect configured cron timezone#127
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/cron-timezone

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Make cron scheduling honor the configured Nerve timezone instead of the server/container timezone.

Root cause

NerveConfig.timezone was defined and documented, but CronService created APScheduler and cron triggers without passing it through. APScheduler therefore defaulted to the host timezone. context_rotate_at had the same problem because it derived "local" time from the OS timezone.

Changes

  • Create a single ZoneInfo(config.timezone) for cron service scheduling.
  • Pass that timezone to the scheduler, cron triggers, interval triggers, cleanup, wakeup sweep, and source schedules.
  • Use the configured timezone for catch-up crontab checks and daily context rotation times.
  • Add regression tests for scheduler timezone, trigger timezone, catch-up timezone, and context_rotate_at.

Validation

  • python -m pytest tests/test_cron.py -q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant