aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFrancesco Rodríguez <frodsan@me.com>2018-10-05 08:19:56 +0200
committerFrancesco Rodríguez <frodsan@me.com>2018-10-05 08:22:42 +0200
commit10408938c219610b99896040acfd73df1be783d2 (patch)
tree1b45352aa8b51f10370e220f5016516b4c61054e /railties
parent9422433e1a875a3f3c3179fff32fb05858604dc6 (diff)
downloadrails-10408938c219610b99896040acfd73df1be783d2.tar.gz
rails-10408938c219610b99896040acfd73df1be783d2.tar.bz2
rails-10408938c219610b99896040acfd73df1be783d2.zip
Add retry_on/discard suggestions for common cases.
This adds the same suggestions added here: https://github.com/rails/rails/blob/01a69e27a4e55504af8fe776826d659550e6f89e/activejob/lib/rails/generators/job/templates/application_job.rb These appear when `app/jobs/application_job.rb` doesn't exist, but not for new applications.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt b/railties/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt
index a009ace51c..d394c3d106 100644
--- a/railties/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt
+++ b/railties/lib/rails/generators/rails/app/templates/app/jobs/application_job.rb.tt
@@ -1,2 +1,7 @@
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