You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello and thanks for the cool gem.
In my project, the user can add new cron tasks and delete old ones. GoodJob::CronEntry has methods for enabling/disabling tasks, but it looks like new tasks can only be added at the rails initialization stage.
Is it possible to dynamically add/remove new tasks for cron? I see that the list of cron tasks can be reinitialized by restarting GoodJob::CronManager. Could you describe the correct way to update the cron task list in runtime?
GoodJob is running in external mode with multiple processes and multiple rails backends.
The text was updated successfully, but these errors were encountered:
Is it possible to dynamically add/remove new tasks for cron?
It's not intended. The analogous design is the system crontab: it's unlikely an application would be designed around updating it.
Why do you want to update it dynamically? My general suggestion for folks is that if there is an application feature for users to schedule things, build tracking those tasks (when should they run, when did they last run) at the application layer, and then have a GoodJob cron entry that runs every hour (or 15 minutes, or minute) that then queries those records. That will scale much better and be easier to track/cancel/update than reaching into GoodJob's internals that could change.
Thank you for your feedback. You are right, the current approach is not the most efficient architectural solution. This issue arose when we were porting an older solution from Sidekiq, which allowed for these types of workarounds.
A good reason to improve the architecture)
Hello and thanks for the cool gem.
In my project, the user can add new cron tasks and delete old ones.
GoodJob::CronEntry
has methods for enabling/disabling tasks, but it looks like new tasks can only be added at the rails initialization stage.Is it possible to dynamically add/remove new tasks for cron? I see that the list of cron tasks can be reinitialized by restarting
GoodJob::CronManager
. Could you describe the correct way to update the cron task list in runtime?GoodJob is running in external mode with multiple processes and multiple rails backends.
The text was updated successfully, but these errors were encountered: