From 86bcbe5974d4aa1b8390091b023ec71fc8d650cb Mon Sep 17 00:00:00 2001 From: Alex Martel <13215031+manofthepeace@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:16:07 -0500 Subject: [PATCH] fix: exponentialBackoffExpireAt should start at 0 --- .../java/io/smallrye/mutiny/helpers/ExponentialBackoff.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation/src/main/java/io/smallrye/mutiny/helpers/ExponentialBackoff.java b/implementation/src/main/java/io/smallrye/mutiny/helpers/ExponentialBackoff.java index a735382b9..4d3e28cc0 100644 --- a/implementation/src/main/java/io/smallrye/mutiny/helpers/ExponentialBackoff.java +++ b/implementation/src/main/java/io/smallrye/mutiny/helpers/ExponentialBackoff.java @@ -104,7 +104,7 @@ public static Function, Publisher> randomExponentialBacko AtomicInteger index = new AtomicInteger(); return t -> t .onItem().transformToUni(failure -> { - int iteration = index.incrementAndGet(); + int iteration = index.getAndIncrement(); Duration delay = getNextDelay(firstBackoff, maxBackoff, jitterFactor, iteration); long checkTime = System.currentTimeMillis() + delay.toMillis();