Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Created September 14, 2012 02:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mrrooijen/3719427 to your computer and use it in GitHub Desktop.
Save mrrooijen/3719427 to your computer and use it in GitHub Desktop.
require 'resque/errors'
class DatabaseBackupJob
def self.perform(id, foo, bar)
# do backup work
rescue Resque::TermException
# write failure to database
# re-enqueue the job so the job won't be lost when scaling down.
Resque.enqueue(DatabaseBackupJob, id, foo, bar)
end
end
@scarver2
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment