workers = Sidekiq::Workers.new
workers.each do |_process_id, _thread_id, work|
p work['payload']['jid']
end
我如何从工人那里得到这份工作?
我有jid,但是作业不在队列中,因为它仍在运行...
答案 0 :(得分:0)
您应该可以通过sidekiq API queue
来获取此信息类似:
queue = Sidekiq::Queue.new("mailer")
queue.select do |job|
job.jid == 'abcdef1234567890' # use your actual jid
end
您也许还可以:
Sidekiq::Status.get_all('9bb6c1c7cede38e6b8085d72') # use jid