Skip to content

Commit 96f0399

Browse files
committed
Reintroduce FixedBackOff(long) constructor
Effectively removing FixedBackOff(Duration) only. See gh-35028 See gh-35110
1 parent 15dd320 commit 96f0399

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-core/src/main/java/org/springframework/util/backoff/FixedBackOff.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* between two attempts and a maximum number of retries.
2222
*
2323
* @author Stephane Nicoll
24+
* @author Sam Brannen
2425
* @since 4.1
2526
*/
2627
public class FixedBackOff implements BackOff {
@@ -50,6 +51,17 @@ public class FixedBackOff implements BackOff {
5051
public FixedBackOff() {
5152
}
5253

54+
/**
55+
* Create an instance with the supplied interval and an unlimited number of
56+
* attempts.
57+
* @param interval the interval between two attempts in milliseconds
58+
* @since 7.0
59+
* @see #setMaxAttempts(long)
60+
*/
61+
public FixedBackOff(long interval) {
62+
this.interval = interval;
63+
}
64+
5365
/**
5466
* Create an instance with the supplied interval and maximum number of attempts.
5567
* @param interval the interval between two attempts in milliseconds

0 commit comments

Comments
 (0)