I'm working on a rails app that uses resque and resque-scheduler to schedule email sending.
Is there a way to get a list of all the scheduled jobs, or even better a list of jobs that have a specific argument?
I've tried a few things like Resque.schedule
but the best I can get is this hash:
{"send_email"=>
{
"class"=>"EmailSendingJob",
"args"=>nil,
"queue"=>"email_queue",
"description"=>"Runs the perform method in EmailSendingJob"
}
}
I actually needed a list of all the delayed jobs, which are one time jobs that will be put in the queue at some time in the future, whereas the scheduled jobs are recurring on a regular basis.
find_delayed_selection
method is exactly what I needed, it allows finding of delayed jobs that have arguments matching certain criteria. This method is not available in the current stable release of resque-scheduler 4.0.0, so I ended up using the master branch.
Here is the link to the pull request where the method was added https://github.com/resque/resque-scheduler/pull/452
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With