Class: Sidekiq::DeadSet
Overview
Allows enumeration of dead jobs within Sidekiq.
Instance Attribute Summary
Attributes inherited from SortedSet
#name
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from JobSet
#delete_by_jid, #delete_by_value, #each, #fetch, #find_job, #schedule
Methods inherited from SortedSet
#clear, #size
Constructor Details
Returns a new instance of DeadSet.
655
656
657
|
# File 'lib/sidekiq/api.rb', line 655
def initialize
super 'dead'
end
|
Class Method Details
.max_jobs ⇒ Object
676
677
678
|
# File 'lib/sidekiq/api.rb', line 676
def self.max_jobs
Sidekiq.options[:dead_max_jobs]
end
|
.timeout ⇒ Object
680
681
682
|
# File 'lib/sidekiq/api.rb', line 680
def self.timeout
Sidekiq.options[:dead_timeout_in_seconds]
end
|
Instance Method Details
#kill(message) ⇒ Object
659
660
661
662
663
664
665
666
667
668
|
# File 'lib/sidekiq/api.rb', line 659
def kill(message)
now = Time.now.to_f
Sidekiq.redis do |conn|
conn.multi do
conn.zadd(name, now.to_s, message)
conn.zremrangebyscore(name, '-inf', now - self.class.timeout)
conn.zremrangebyrank(name, 0, - self.class.max_jobs)
end
end
end
|
#retry_all ⇒ Object
670
671
672
673
674
|
# File 'lib/sidekiq/api.rb', line 670
def retry_all
while size > 0
each(&:retry)
end
end
|