Created
March 8, 2021 17:35
-
-
Save benoittgt/183797ddab355d7384a7dffa46aa3391 to your computer and use it in GitHub Desktop.
Get first job status from Sidekiq that match a class
This file contains hidden or 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
| 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