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

岁酱吖の 提交于 2019-12-03 00:59:13

问题


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


回答1:


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.




回答2:


You can also do it like this:

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



回答3:


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



来源:https://stackoverflow.com/questions/6946041/how-do-you-tell-a-specific-delayedjob-to-run-in-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!