aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-10-05 17:15:43 +0900
committerGitHub <noreply@github.com>2018-10-05 17:15:43 +0900
commit1ceaf7db5013a233bdc671b3f46583c4c1189fe1 (patch)
tree1b45352aa8b51f10370e220f5016516b4c61054e /railties
parent9422433e1a875a3f3c3179fff32fb05858604dc6 (diff)
parent10408938c219610b99896040acfd73df1be783d2 (diff)
downloadrails-1ceaf7db5013a233bdc671b3f46583c4c1189fe1.tar.gz
rails-1ceaf7db5013a233bdc671b3f46583c4c1189fe1.tar.bz2
rails-1ceaf7db5013a233bdc671b3f46583c4c1189fe1.zip
Merge pull request #34087 from frodsan/application_job_suggestions
Add retry_on/discard suggestions for common cases to ApplicationJob for new apps.
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