Created
December 15, 2011 15:41
-
-
Save dhiemstra/1481541 to your computer and use it in GitHub Desktop.
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 SomeJob < BaseJob | |
def self.perform(user_id) | |
# do stuff | |
rescue SomeError | |
retry_later(user_id) | |
end | |
end |
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 BaseJob | |
def retry_later | |
Resque.enqueue_at(1.hour.from_now, self.new.class, *args) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment