Reintroduce FixedBackOff(long) constructor

Effectively removing FixedBackOff(Duration) only.

See gh-35028
See gh-35110
This commit is contained in:
Juergen Hoeller 2025-06-28 12:11:02 +02:00
parent 15dd320b95
commit 96f0399072
1 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@ package org.springframework.util.backoff;
* between two attempts and a maximum number of retries. * between two attempts and a maximum number of retries.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Sam Brannen
* @since 4.1 * @since 4.1
*/ */
public class FixedBackOff implements BackOff { public class FixedBackOff implements BackOff {
@ -50,6 +51,17 @@ public class FixedBackOff implements BackOff {
public FixedBackOff() { public FixedBackOff() {
} }
/**
* Create an instance with the supplied interval and an unlimited number of
* attempts.
* @param interval the interval between two attempts in milliseconds
* @since 7.0
* @see #setMaxAttempts(long)
*/
public FixedBackOff(long interval) {
this.interval = interval;
}
/** /**
* Create an instance with the supplied interval and maximum number of attempts. * Create an instance with the supplied interval and maximum number of attempts.
* @param interval the interval between two attempts in milliseconds * @param interval the interval between two attempts in milliseconds