Is there a way to get a list of all the jobs currently in the queue and running? Basically, I want to know if a job of given class is already there, I don\'t want to insert my o
if you want to list all currently running jobs from console, try this
workers = Sidekiq::Workers.new
workers.each do |_process_id, _thread_id, work|
p work
end
a work
is a hash.
to list all queue data.
queues = Sidekiq::Queue.all
queues.each do |queue|
queue.each do |job|
p job.klass, job.args, job.jid
end
end
for a specific queue change this to Sidekiq::Queue.new('queue_name')
similarly you can get all scheduled jobs using Sidekiq::ScheduledSet.new