Created
October 28, 2012 18:05
-
-
Save jeremyruppel/3969320 to your computer and use it in GitHub Desktop.
Switching from Resque to Sidekiq at Remind101
This file contains 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
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