Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usability Improvement: Warn when recurring task's schedule configuration missing #521

Open
apsoto opened this issue Feb 22, 2025 · 1 comment

Comments

@apsoto
Copy link

apsoto commented Feb 22, 2025

This is user error, but I did spend a bunch of time troubleshooting why recurring tasks weren't being loaded.

I realized that my configuration was incorrect, but it wasn't clearly obvious until I ran through the configuration code and noticed that it skips loading the task if the schedule option is missing

https://github.com/rails/solid_queue/blob/main/lib/solid_queue/configuration.rb#L144

This could fail to load tasks for a number of reasons from user error:

  • bad cut and paste (losing the schedule)
  • spelling error on the option
  • using incorrect option from another scheduling tool's config (cron: 0 * * * * )

Since we are loading from recurring.yml the intent is to have a recurring task. If the schedule option is missing, we should at least warn.

Thanks!

@rosa
Copy link
Member

rosa commented Feb 22, 2025

Ahh, indeed! So sorry about that. It was frustrating, and several folks brought it up 😅 🙈 . The good news is that we fixed it! We changed this behaviour in version 1.1.1, so if you update to the last version (currently 1.1.3), it'll fail loudly when a recurring task is invalid.

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

No branches or pull requests

2 participants