Skip to content

Instantly share code, notes, and snippets.

@jeremyruppel
Created October 28, 2012 18:05
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 jeremyruppel/3969320 to your computer and use it in GitHub Desktop.
Save jeremyruppel/3969320 to your computer and use it in GitHub Desktop.
Switching from Resque to Sidekiq at Remind101
class DeliverMessage
def self.perform( id )
Message.find( id ).deliver
end
def self.before_perform_ensure_not_delivered( id )
raise Resque::Job::DontPerform if Message.find( id ).delivered?
end
def self.before_perform_ensure_not_overdue( id )
raise Resque::Job::DontPerform if Message.find( id ).overdue?
end
# and even more hooks...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment