diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-04 14:57:10 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-04 14:57:10 -0700 |
commit | 01a69e27a4e55504af8fe776826d659550e6f89e (patch) | |
tree | 72f3bbe9805ec69711e314d41150ba42f279499a /activejob/lib/rails | |
parent | 5b469da6ec482414c5f59762ae8e82de7e07c365 (diff) | |
download | rails-01a69e27a4e55504af8fe776826d659550e6f89e.tar.gz rails-01a69e27a4e55504af8fe776826d659550e6f89e.tar.bz2 rails-01a69e27a4e55504af8fe776826d659550e6f89e.zip |
Offer invitations to use retry_on/discard_on for common cases
Diffstat (limited to 'activejob/lib/rails')
-rw-r--r-- | activejob/lib/rails/generators/job/templates/application_job.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activejob/lib/rails/generators/job/templates/application_job.rb b/activejob/lib/rails/generators/job/templates/application_job.rb index 0b113b950e..f93745a31a 100644 --- a/activejob/lib/rails/generators/job/templates/application_job.rb +++ b/activejob/lib/rails/generators/job/templates/application_job.rb @@ -1,4 +1,9 @@ <% module_namespacing do -%> class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError end <% end -%> |