100

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

Trip
  • 26,756
  • 46
  • 158
  • 277
  • possible duplicate of [Manually Retry Job in Delayed_job](http://stackoverflow.com/questions/3312054/manually-retry-job-in-delayed-job) – smathy Aug 02 '12 at 04:27

3 Answers3

179

You can also do it like this:

Delayed::Worker.new.run( Delayed::Job.find(x) ) 
Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245
David Tuite
  • 22,258
  • 25
  • 106
  • 176
136

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.

schiza
  • 1,900
  • 1
  • 15
  • 18
  • 4
    Read carefully the answer's author note: _"it won't run any other things like destroying job that was done"_. I say so because I did not read it and I was getting crazy. Check the [@DavidTuite's answer](http://stackoverflow.com/a/20146200/316700) – fguillen Nov 01 '16 at 07:25
0

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

rassom
  • 2,896
  • 5
  • 34
  • 45
  • 1
    Thanks for the positive comment ;-) It could be that the person asking - or people coming to this question - had the problem on Heroku. – rassom Jan 16 '20 at 17:28