-
Notifications
You must be signed in to change notification settings - Fork 128
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
Customize the parent class of SolidQueue::RecurringJob #356
Comments
Yes, good idea! I'll get this done shortly. I could also allow providing the job class to be used in this case 🤔 Like |
Thanks for the response 😄 I have considered the use case of being able to specify our own Job class. config.solid_queue.recurring_command_job = "MyRecurringCommandJob" Allows defining processes other than
|
I just noticed that you already have the ability to customize a job class 👀 Rails.application.config.after_initialize do # or to_prepare
SolidQueue::RecurringTask.default_job_class = MyRecurringCommandJob
end |
Oh wow, yes, it is! 🤣 I added this ages ago when I first started implementing this feature. Then, I had to work on other non-solid queue stuff at work, and came back to it recently. I had completely forgotten I had added that! 🤣 I also forgot to expose it or document it 😅 I think this could work! My initial idea was to also allow people to do different things with their |
Introduction
Allow specifying recurring tasks just with a "command"
I find this feature very interesting.
However, there is one barrier to its use.
That is, the parent of
SolidQueue::RecurringJob
is fixed atActiveJob::Base
.I have defined error handling in ApplicationJob as described below.
https://github.com/rails/solid_queue/blob/67b964d5e9d1120e0f198dc1ef538a0aff966133/README.md#error-reporting-on-jobs
This error handling does not work when using “command”.
Proposal
How about allowing customization of the
SolidQueue::RecurringJob
parent class?Thinking something similar to
MaintenanceTasks.parent_controller
.https://github.com/Shopify/maintenance_tasks/blob/d98544fb3de714a14082b64e6831980945db01cf/README.md#customizing-the-parent-controller-for-the-web-ui
What do you think?
Workaround
Just extend SolidQueue::RecurringJob.
The text was updated successfully, but these errors were encountered: