aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_job/performing.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-05-22 20:35:02 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-05-22 20:35:02 +0200
commitef4aff07a41f1249baade695e68c75a8db3ded58 (patch)
treeda3d9edc6f612a2f6106696fe423a5d8f1e5f28b /lib/active_job/performing.rb
parent387a7d993573b1492b1ed39f6803acc77af9233b (diff)
downloadrails-ef4aff07a41f1249baade695e68c75a8db3ded58.tar.gz
rails-ef4aff07a41f1249baade695e68c75a8db3ded58.tar.bz2
rails-ef4aff07a41f1249baade695e68c75a8db3ded58.zip
Add exception handling with built-in retry options
Diffstat (limited to 'lib/active_job/performing.rb')
-rw-r--r--lib/active_job/performing.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/active_job/performing.rb b/lib/active_job/performing.rb
index ef17a39f85..c3f57873e5 100644
--- a/lib/active_job/performing.rb
+++ b/lib/active_job/performing.rb
@@ -1,13 +1,22 @@
+require 'active_support/rescuable'
require 'active_job/arguments'
module ActiveJob
module Performing
+ extend ActiveSupport::Concern
+
+ included do
+ include ActiveSupport::Rescuable
+ end
+
def perform_with_hooks(*serialized_args)
self.arguments = Arguments.deserialize(serialized_args)
run_callbacks :perform do
perform *arguments
end
+ rescue => exception
+ rescue_with_handler(exception)
end
def perform(*)