How do you tell a specific Delayed::Job to run in console?

Ruby on-RailsDelayed Job

Ruby on-Rails Problem Overview


For some reason, Delayed::Job's has decided to queue up but not excecute anything even though I've restarted it several times, even kill -9'd it and restarted it. It won't run any jobs.

Can I , in /console, specify a specific job and tell it to work?

Ex:.. Delayed::Job.find(x).run

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

You can also do it like this:

Delayed::Worker.new.run( Delayed::Job.find(x) ) 

Solution 2 - Ruby on-Rails

answering how to run specific job from console:

Delayed::Job.find(x).invoke_job

but you must remember that it won't run any other things like destroying job that was done or so on. just running the job/task.

Solution 3 - Ruby on-Rails

On Heroku I had a "stuck" job and just had to run heroku restart for the worker/job to start again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTripView Question on Stackoverflow
Solution 1 - Ruby on-RailsDavid TuiteView Answer on Stackoverflow
Solution 2 - Ruby on-RailsschizaView Answer on Stackoverflow
Solution 3 - Ruby on-RailsrassomView Answer on Stackoverflow