Created
January 19, 2016 12:02
-
-
Save yagihiro/a705a2361fa5111f2f29 to your computer and use it in GitHub Desktop.
Sidekiq を re-schedulable にするスニペット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 最初にスケジュール済みのジョブを削除する | |
Sidekiq::ScheduledSet.new.each do |e| | |
if e.item[‘wrapped’] == self.class.to_s | |
e.delete | |
end | |
end | |
# もろもろ処理 | |
# 最後に reschedule する | |
self.class.set(wait: 30.second).perform_later |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment