How to find Sidekiq old job status by jid

14.3k Views Asked by At

I am using Sidekiq to run a background jobs for my Rails application.

I want to find out status (InProgress, Completed, Failed, Dead) of the old Sidekiq job executed 10 or 15 days ago by using jid.

Is there a way to find Sidekiq job status by using jid?

1

There are 1 best solutions below

0
Aleksandr Babak On

You can get some information using

 Sidekiq::Queue.new('you_queue_name').find_job(jid)
 Sidekiq::ScheduledSet.new.find_job(jid)
 Sidekiq::RetrySet.new.find_job(jid)
 Sidekiq::JobSet.new('you_queue_name').find_job(jid)

Also you can use https://github.com/utgarda/sidekiq-status gem.

Or ask redis (or your backend) directly. You can find some tips in this gem sources