Class: Sidekiq::RetrySet

Inherits:
JobSet show all
Defined in:
lib/sidekiq/api.rb

Overview

The set of retries within Sidekiq. Based on this, you can search/filter for jobs. Here’s an example where I’m selecting all jobs of a certain type and deleting them from the retry queue.

See the API wiki page for usage notes and examples.

Instance Attribute Summary

Attributes inherited from SortedSet

#Name, #name

Instance Method Summary collapse

Methods inherited from JobSet

#each, #fetch, #find_job, #schedule

Methods inherited from SortedSet

#clear, #scan, #size

Constructor Details

#initializeRetrySet

Returns a new instance of RetrySet.



790
791
792
# File 'lib/sidekiq/api.rb', line 790

def initialize
  super "retry"
end

Instance Method Details

#kill_allObject

Kills all jobs pending within the retry set.



800
801
802
# File 'lib/sidekiq/api.rb', line 800

def kill_all
  each(&:kill) while size > 0
end

#retry_allObject

Enqueues all jobs pending within the retry set.



795
796
797
# File 'lib/sidekiq/api.rb', line 795

def retry_all
  each(&:retry) while size > 0
end