Closed kaikousa closed 8 years ago
Actually it seems that my "workaround" only makes the code run, the job is not delayed at all so the options are ignored.
Try Backburner::Worker.enqueue(NewsletterJob, ['foo@admin.com', 'lorem ipsum...'], :delay => 1.hour)
Note the use of Backburner::Worker
I was blind like a bat! :D Thanks @nesquena !!
I'm trying to implement a delayed job that would wait 30 seconds before running.
The job is as follows
I run the worker queues like this:
When the worker picks up the job and tries to run it I get the following exception:
I tried reading the source code and to me it seems that there is something funky going on with how the arguments are handled and passed down to jobs as the job seems to get the options as well. Maybe a mistake with user of multiple arguments (
*args
), but I'm not completely sure.I hacked my way around this by changing the job
perform
-method to:This saves the day but I would like to see a solution for the problem (or to know if I'm doing something wrong) as now the program doesn't work when passing options like it is documented. I can also look into it and hopefully contribute with PR if I get some pointers about where to look for.