Skip to content

Commit cb7b1ea

Browse files
committed
Add retry_jitter to 6.1 new framework defaults
This was added to the defaults for new applications in e2cdffc, but we also need an entry in the new framework defaults initializer for upgrading applications.
1 parent d5a3b2e commit cb7b1ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

railties/lib/rails/application/configuration.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ def load_defaults(target_version)
159159
when "6.1"
160160
load_defaults "6.0"
161161

162-
if respond_to?(:active_job)
163-
active_job.retry_jitter = 0.15
164-
end
165-
166162
if respond_to?(:active_record)
167163
active_record.has_many_inversing = true
168164
end
@@ -172,6 +168,7 @@ def load_defaults(target_version)
172168
end
173169

174170
if respond_to?(:active_job)
171+
active_job.retry_jitter = 0.15
175172
active_job.skip_after_callbacks_if_terminated = true
176173
end
177174

railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_1.rb.tt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# Track Active Storage variants in the database.
1313
# Rails.application.config.active_storage.track_variants = true
1414

15+
# Apply random variation to the delay when retrying failed jobs.
16+
# Rails.application.config.active_job.retry_jitter = 0.15
17+
1518
# Stop executing `after_enqueue`/`after_perform` callbacks if
1619
# `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
1720
# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true

0 commit comments

Comments
 (0)