fix(cron): skip validation for disabled cronjobs#640
Merged
Conversation
validate_cronjobs() now skips jobs with enabled=false, aligning startup validation with runtime scheduling semantics. Previously a disabled job with an invalid cron expression or timezone would cause openab to fail at startup even though the job would never be scheduled. Discovered during four-monk review of PR #638. Co-authored-by: 擺渡法師 <codex@openab.dev>
|
All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: This PR will be automatically closed in 3 days if the link is not added. |
thepagent
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this solve?
validate_cronjobs()validates all cronjob configs at startup, including those withenabled: false. This means a disabled job with an invalid cron expression or timezone causes openab to fail at startup, even though the job would never be scheduled.This contradicts the user expectation that
enabled: falsemeans "this job does not affect the system."The runtime scheduler (
parse_job_list()) already correctly skips disabled jobs — only the startup preflight validation was inconsistent.Discovered by 擺渡法師 (Codex) during four-monk review of PR #638.
Changes
src/cron.rsif !job.enabled { continue; }tovalidate_cronjobs()src/cron.rsTesting
Related