How can I see the delayed job queue?

Ruby on-RailsDelayed Job

Ruby on-Rails Problem Overview


I wonder if I succeeded to get Delayed::Job working. Can't see jobs in the delayed_jobs table.

  • Is that normal?
  • Is there any other ways too see job queue?

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

DelayedJob stores a database record for each enqueued job so you can retrieve them directly through the rails console (assuming you are using ActiveRecord or similar).

Open the rails console:

$ rails c

and then query the enqueued jobs:

$ Delayed::Job.all

or

$ Delayed::Job.last

Check out the documentation.

If you installed delayed_job with another database like Redis you may want to go and check in there the queued jobs.

Solution 2 - Ruby on-Rails

You should see jobs in the delayed_jobs table, yes. But when delayed jobs are run successfully they're deleted. So it may just be a fleeting thing. (Delayed Job checks the table for new jobs to run every 5 seconds, so the record may only last a few seconds on average given a short-running job.) I usually make sure the delayed job daemon is turned off if I want to inspect the payload objects in the delayed_jobs table.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionknotitoView Question on Stackoverflow
Solution 1 - Ruby on-RailsNicolas GarnilView Answer on Stackoverflow
Solution 2 - Ruby on-RailspdobbView Answer on Stackoverflow