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
script/delayed_job can be used to manage a background process which will start working off jobs. To do so, add gem "daemons" to your Gemfile and make sure you've run rails generate delayed_job . Workers can be running on any computer, as long as they have access to the database and their clock is in sync.
The most simple way to check whether delayed_job is running or not, is to check at locked_by field. This field will contain the worker or process locking/processing the job. Running Delayed::Job. where('locked_by is not null') will give you some results, if there are jobs running.
You can also do it like this:
Delayed::Worker.new.run( Delayed::Job.find(x) )
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.
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