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

#delete_by_jid, #delete_by_value, #each, #fetch, #find_job, #schedule

Methods inherited from SortedSet

#as_json, #clear, #scan, #size

Constructor Details

#initializeRetrySet

Returns a new instance of RetrySet.



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

def initialize
  super("retry")
end

Instance Method Details

#kill_allObject

Kills all jobs pending within the retry set.



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

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

#retry_allObject

Enqueues all jobs pending within the retry set.



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

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