Skip to content

Instantly share code, notes, and snippets.

@ngsmrk
Created August 11, 2014 11:51
Show Gist options
  • Save ngsmrk/4ad439143622a46b8a5b to your computer and use it in GitHub Desktop.
Save ngsmrk/4ad439143622a46b8a5b to your computer and use it in GitHub Desktop.
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
scheduled_queue = Sidekiq::ScheduledSet.new
retry_queue = Sidekiq::RetrySet.new
default_queue = Sidekiq::Queue.new("default")
default_queue.each do | job |
class_arg = job.args[0].split('-').select { | arg | arg.match(' !ruby/class') }[0]
p class_arg.split[1].gsub '\'', '' unless class_arg.nil?
end
@joshweir
Copy link

joshweir commented Jun 7, 2019

appreciate this thanks

@shahzeb1
Copy link

shahzeb1 commented Jun 28, 2019

Don't forget at the top to:

require 'sidekiq/api'

If you want to see the list of scheduled jobs:

scheduled = Sidekiq::ScheduledSet.new.select
scheduled.map do |job|
  p job
end

Read more.

@Subby
Copy link

Subby commented Apr 9, 2020

Excellent, thank you!

@ninadbstack
Copy link

Thanks buddy!

@praveen-comakeit
Copy link

Thanks Buddy!!!

@MRaffCU
Copy link

MRaffCU commented Sep 1, 2022

Thanks buddy

@jm3
Copy link

jm3 commented Nov 14, 2022

Thanks buddy

@mateussantiago
Copy link

Thanks buddy

@T-hawk
Copy link

T-hawk commented Jul 6, 2023

Thanks buddy

@exxocism
Copy link

Thanks buddy

@tif-calin
Copy link

Thanks buddy

@kulbirsaini
Copy link

Thanks buddy

@GregNing
Copy link

GregNing commented Jul 4, 2024

Thanks buddy

@jndrkmllh
Copy link

Thanks buddy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment