Hoseong Son
Hoseong Son

Reputation: 257

Stop Sidekiq recurring jobs

I'm using Sidetiq and Sidekiq together to recurring jobs :

 include Sidekiq::Worker
 include Sidetiq::Schedulable

 recurrence { secondly(3) }

 def perform(id,last_occurrence)
    # magic happens
 end

However, now I want to stop the entire enqueuing process. I want to remove all the process from Sidetiq. How can I do?

Upvotes: 2

Views: 1281

Answers (1)

Brad Decker
Brad Decker

Reputation: 756

Kind of late on this it looks like, but here we go anywho.

You can delete all scheduled sidetiq process like this:

Sidetiq::scheduled.each { |occurrence| occurrence.delete }

As far as preventing sidetiq from queuing additional jobs, i'm not sure how that works or how to dynamically stop it.

Upvotes: 2

Related Questions