Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yagihiro
Created January 19, 2016 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yagihiro/a705a2361fa5111f2f29 to your computer and use it in GitHub Desktop.
Save yagihiro/a705a2361fa5111f2f29 to your computer and use it in GitHub Desktop.
Sidekiq を re-schedulable にするスニペット
# 最初にスケジュール済みのジョブを削除する
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