Skip to content

Instantly share code, notes, and snippets.

@benoittgt
Created March 8, 2021 17:35
Show Gist options
  • Select an option

  • Save benoittgt/183797ddab355d7384a7dffa46aa3391 to your computer and use it in GitHub Desktop.

Select an option

Save benoittgt/183797ddab355d7384a7dffa46aa3391 to your computer and use it in GitHub Desktop.
Get first job status from Sidekiq that match a class
process, thread, msg = workers.select { |process, thread, msg| Sidekiq::Job.new(msg['payload']).display_class == 'GenerateInvoices
Job' }.first
job = Sidekiq::Job.new(msg['payload'])
puts "job class: #{job.display_class}, time: #{Time.at(message['run_at'])}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment