Skip to content

Fix: Detect and warn when schedules generate multiple CRONs#707

Merged
rosa merged 3 commits intorails:mainfrom
himanshukale36:fix-multiple-cron-warning
Feb 18, 2026
Merged

Fix: Detect and warn when schedules generate multiple CRONs#707
rosa merged 3 commits intorails:mainfrom
himanshukale36:fix-multiple-cron-warning

Conversation

@himanshukale36
Copy link
Copy Markdown
Contributor

Fixes #703

  • Use Fugit::Nat.parse with multi: :fail to detect schedules that generate multiple CRONs
  • Raise validation error with clear message when multiple CRONs detected
  • Add tests for single CRON, multiple times (same/different minutes)
  • Prevents silent failures where only first CRON was used

Fixes rails#703

- Use Fugit::Nat.parse with multi: :fail to detect schedules that generate multiple CRONs
- Raise validation error with clear message when multiple CRONs detected
- Add tests for single CRON, multiple times (same/different minutes)
- Prevents silent failures where only first CRON was used
Copy link
Copy Markdown
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, and thanks for working on this 🙏🏻 This is a good idea! I'd like the changes to be a bit different, though, as it's a bit strange that parsed_schedule returns :multiple_crons_detected. Let me think about it.

@himanshukale36
Copy link
Copy Markdown
Contributor Author

Sorry for the delay, and thanks for working on this 🙏🏻 This is a good idea! I'd like the changes to be a bit different, though, as it's a bit strange that parsed_schedule returns :multiple_crons_detected. Let me think about it.

Thanks for the feedback! I see your point about parsed_schedule returning :multiple — that does make the API a bit unintuitive.

@rosa
Copy link
Copy Markdown
Member

rosa commented Feb 18, 2026

I pushed some small tweaks and I think it looks better now!

@rosa rosa merged commit 5518a4d into rails:main Feb 18, 2026
126 of 128 checks passed
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.

solid_queue doesn't raise a warning when fugit should generate multiple CRONs

2 participants