Created
July 11, 2024 15:10
-
-
Save alazycoder101/5956a1d2df4a985c34720990a2ac830c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_queue(queues=[]) | |
if queues.empty? | |
queues = Sidekiq::Queue.all | |
else | |
queues = queues.map { |queue| Sidekiq::Queue.new(queue) } | |
end | |
queues.each do |queue| | |
queue.each do |job| | |
p job | |
p job.klass, job.args, job.jid | |
end | |
end | |
end | |
def check_schedule | |
Sidekiq::ScheduledSet.new.each do |job| | |
puts job.at | |
end | |
def check_deadset | |
Sidekiq::DeadSet.new.each do |job| | |
puts job | |
end | |
end | |
def check_retryset | |
Sidekiq::RetrySet.new.each do |job| | |
puts job | |
end | |
end | |
def check_running_jobs | |
workers = Sidekiq::Workers.new | |
workers.each do |process_id, thread_id, work| | |
p "process_id=#{process_id} thread_id=#{thread_id}" | |
p work | |
puts "created_at=#{Time.at(work['payload']['created_at'])} enqueued_at=#{Time.at(work['payload']['enqueued_at'])} run_at=#{Time.at(work['run_at'])}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment