6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Sidekiqで処理待ち、処理中のjobを取得する

Posted at

ActiveJobでqueue adaptorにSidekiqを使ってて、ジョブの状況を確認したいので調査しました :bulb:

環境

sidekiq (5.1.1)

コード

# 処理中のjob
workers = Sidekiq::Workers.new
workers.each do |_process_id, _thread_id, work|
  p work
end

# 処理待ちのjob
queues = Sidekiq::Queue.all
queues.each do |queue|
  queue.each do |job|
    p job.klass, job.args, job.jid
  end
end

以上です :hugging:

参考

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?