如何告诉特定的 Delayed: : Job 在控制台中运行?

由于某种原因,Delayed: : Job 决定排队但不执行任何操作,即使我已经重新启动了它几次,甚至杀死了它并重新启动它。它不会运行任何作业。

我可以在/控制台中指定一个特定的作业并告诉它工作吗?

例句: . . Delayed::Job.find(x).run

42260 次浏览

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.

You can also do it like this:

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

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