Skip to content

Instantly share code, notes, and snippets.

@krasio
Created March 9, 2011 20:42
Show Gist options
  • Save krasio/862966 to your computer and use it in GitHub Desktop.
Save krasio/862966 to your computer and use it in GitHub Desktop.
module Resque
class Job
alias_method :original_perform, :perform
def perform
original_perform
rescue ActiveRecord::StatementInvalid => e
if e.message =~ /server has gone away/i
ActiveRecord::Base.verify_active_connections!
retry
else
raise e
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment