Class: Sidekiq::ScheduledSet

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

Overview

Allows enumeration of scheduled jobs 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.

r = Sidekiq::ScheduledSet.new
r.select do |retri|
  retri.klass == 'Sidekiq::Extensions::DelayedClass' &&
  retri.args[0] == 'User' &&
  retri.args[1] == 'setup_new_subscriber'
end.map(&:delete)

Instance Attribute Summary

Attributes inherited from SortedSet

#name

Instance Method Summary collapse

Methods inherited from JobSet

#delete, #each, #fetch, #find_job, #schedule

Methods inherited from SortedSet

#clear, #size

Constructor Details

#initializeScheduledSet

Returns a new instance of ScheduledSet.



567
568
569
# File 'lib/sidekiq/api.rb', line 567

def initialize
  super 'schedule'
end