I am using collectiveidea for rails 2.3.8. I am creating array of delayed jobs to perform some tasks, after some time I want to destroy all the delayed jobs which are running. If anyone know the way to do this please help me.
Using delayed_job 4.0. 2, when -m is passed to 'delayed_job -m start', both delayed_job. pid and delayed_job_monitor. pid are written to tmp/pids, and 'delayed_job stop' kills both processes.
Delayed Job, also known as DJ, makes it easy to add background tasks to your Rails applications on Heroku. You can also use Resque and many other popular background queueing libraries. Delayed Job uses your database as a queue to process background jobs.
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.
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.
You can invoke rake jobs:clear
to delete all jobs in the queue.
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