Skip to content

Instantly share code, notes, and snippets.

@dhiemstra
Created December 15, 2011 15:41
Show Gist options
  • Save dhiemstra/1481541 to your computer and use it in GitHub Desktop.
Save dhiemstra/1481541 to your computer and use it in GitHub Desktop.
class SomeJob < BaseJob
def self.perform(user_id)
# do stuff
rescue SomeError
retry_later(user_id)
end
end
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