SORU
2 EKİM 2012, Salı


Komutları Sırada ne bakmak için ve Sidekiq sıra temizlemek için konsol var mı?

Delayed_jobs bu sırada ne ve gerektiğinde kuyruk temizleme kolaylığı görmek konsolu girmeden yöntemi kullanmaya alışık değilim. Bunun için Sidekiq benzer komutlar var mı? Teşekkürler!

CEVAP
21 EYLÜL 2013, CUMARTESİ


API for viewing and managing queues ergonomik vardır.

Varsayılan olarak gerekli değildir.

require 'sidekiq/api'

İşte bir alıntı:

# get a handle to the default queue
default_queue = Sidekiq::Queue.new 

# get a handle to the mailer queue
mailer_queue = Sidekiq::Queue.new("mailer") 

# How many jobs are in the default queue?
default_queue.size # => 1001

# How many jobs are in the mailer queue?
mailer_queue.size # => 50

#Deletes all Jobs in a Queue, by removing the queue.    
default_queue.clear

Ayrıca bazı Özet istatistikler alabilirsiniz.

stats = Sidekiq::Stats.new

# Get the number of jobs that have been processed.
stats.processed # => 100

# Get the number of jobs that have failed.    
stats.failed # => 3

# Get the queues with name and number enqueued.
stats.queues # => { "default" => 1001, "email" => 50 }

#Gets the number of jobs enqueued in all queues (does NOT include retries and scheduled jobs).
stats.enqueued # => 1051 

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • boburnham

    boburnham

    11 Temmuz 2006
  • JayzTwoCents

    JayzTwoCents

    26 AĞUSTOS 2012
  • Shameless Maya

    Shameless Ma

    24 Mayıs 2012