Skip to content

Commit a67348a

Browse files
committed
task: Fix AdaptiveRetry to keep retrying retriable Left errors for free when shouldPayFailureCost is false
1 parent 803da57 commit a67348a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/src/main/scala/ox/resilience/AdaptiveRetry.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ case class AdaptiveRetry(
7676
// If we want to retry we try to acquire tokens from bucket
7777
if config.resultPolicy.isWorthRetrying(value) then
7878
if shouldPayFailureCost(Left(value)) then ScheduleStop(!tokenBucket.tryAcquire(failureCost))
79-
else ScheduleStop.Yes
79+
else ScheduleStop.No
8080
else ScheduleStop.Yes
8181
case Right(value) =>
8282
// If we are successful, we release tokens to bucket and end schedule

0 commit comments

Comments
 (0)