Open minamete opened 2 weeks ago
Huh, yes, this seems wrong. I'll look into it, it shouldn't crash in that way.
I believe here are some of the culprits:
lib/solid_queue/dispatcher/recurring_task.rb
line 41: for a cron job that is not run using SolidQueue that returns false
lib/solid_queue/dispatcher/recurring_task.rb
line 68 into app/models/solid_queue/recurring_execution.rb
line 11: for a cron job that is run using SolidQueue that returns false
@minamete, indeed! I realised the problem: I need to provide a block to perform_later
to ensure I get the instance of the job class enqueued, my bad.
I'll work on a fix shortly.
In the end I went for something simpler in #252, I think that should do it.
I was attempting to have a recurring job in cron, and I kept on getting errors with no trace back in the SolidQueue service:
After a bit of investigation, it turns out that if
perform_later
returns false for a cron job, this will be the error displayed. Similarly, if I make the job not use SolidQueue, it will display an error that job_id is undefined for false:FalseClass. I believe, but I'm not sure that it can happen if a recurring job is attempted to be enqueued while it's already running, or if multiple instances of SolidQueue are trying to enqueue the same recurring job at the same time.Would it be a good idea to give a more descriptive error in the case that this happens?