Skip to content

Commit 03dae98

Browse files
committed
Remove deprecated :exponentially_longer value for the :wait in retry_on
1 parent 7982896 commit 03dae98

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

activejob/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `:exponentially_longer` value for the `:wait` in `retry_on`.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated support to set numeric values to `scheduled_at` attribute.
26

37
*Rafael Mendonça França*

activejob/lib/active_job/exceptions.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ module ClassMethods
6060
# end
6161
# end
6262
def retry_on(*exceptions, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: JITTER_DEFAULT)
63-
if wait == :exponentially_longer
64-
ActiveJob.deprecator.warn(<<~MSG.squish)
65-
`wait: :exponentially_longer` will actually wait polynomially longer and is therefore deprecated.
66-
Prefer `wait: :polynomially_longer` to avoid confusion and keep the same behavior.
67-
MSG
68-
end
6963
rescue_from(*exceptions) do |error|
7064
executions = executions_for(exceptions)
7165
if attempts == :unlimited || executions < attempts
@@ -168,7 +162,7 @@ def determine_delay(seconds_or_duration_or_algorithm:, executions:, jitter: JITT
168162
jitter = jitter == JITTER_DEFAULT ? self.class.retry_jitter : (jitter || 0.0)
169163

170164
case seconds_or_duration_or_algorithm
171-
when :exponentially_longer, :polynomially_longer
165+
when :polynomially_longer
172166
# This delay uses a polynomial backoff strategy, which was previously misnamed as exponential
173167
delay = executions**4
174168
delay_jitter = determine_jitter_for_delay(delay, jitter)

activejob/test/cases/exceptions_test.rb

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -379,29 +379,5 @@ def adapter_skips_scheduling?(queue_adapter)
379379
]
380380
assert_equal expected_array, JobBuffer.values.last(2)
381381
end
382-
383-
class ::LegacyExponentialNamingError < StandardError; end
384-
test "wait: :exponentially_longer is deprecated but still works" do
385-
assert_deprecated(ActiveJob.deprecator) do
386-
class LegacyRetryJob < RetryJob
387-
retry_on LegacyExponentialNamingError, wait: :exponentially_longer, attempts: 10, jitter: nil
388-
end
389-
end
390-
391-
travel_to Time.now
392-
LegacyRetryJob.perform_later "LegacyExponentialNamingError", 5, :log_scheduled_at
393-
394-
assert_equal [
395-
"Raised LegacyExponentialNamingError for the 1st time",
396-
"Next execution scheduled at #{(Time.now + 3.seconds).to_f}",
397-
"Raised LegacyExponentialNamingError for the 2nd time",
398-
"Next execution scheduled at #{(Time.now + 18.seconds).to_f}",
399-
"Raised LegacyExponentialNamingError for the 3rd time",
400-
"Next execution scheduled at #{(Time.now + 83.seconds).to_f}",
401-
"Raised LegacyExponentialNamingError for the 4th time",
402-
"Next execution scheduled at #{(Time.now + 258.seconds).to_f}",
403-
"Successfully completed job"
404-
], JobBuffer.values
405-
end
406382
end
407383
end

guides/source/7_2_release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Please refer to the [Changelog][active-job] for detailed changes.
149149

150150
* Remove deprecated support to set numeric values to `scheduled_at` attribute.
151151

152+
* Remove deprecated `:exponentially_longer` value for the `:wait` in `retry_on`.
153+
152154
### Deprecations
153155

154156
* Deprecate `Rails.application.config.active_job.use_big_decimal_serialize`.

0 commit comments

Comments
 (0)