Skip to content

Commit cf60cc2

Browse files
author
Yegor Bugayenko
committed
wait for 1 min max
1 parent 146b99d commit cf60cc2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/co/stateful/Atomic.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,12 @@ public void run() {
141141
);
142142
}
143143
++attempt;
144-
final long delay = (long) Tv.HUNDRED
145-
+ (long) Atomic.RANDOM.nextInt(Tv.HUNDRED)
144+
final long delay = Math.min(
145+
TimeUnit.MINUTES.toMillis(1L),
146+
(long) Tv.HUNDRED + (long) Atomic.RANDOM.nextInt(Tv.HUNDRED)
146147
// @checkstyle MagicNumber (1 line)
147-
+ (long) StrictMath.pow(5.0d, (double) attempt + 1.0d);
148+
+ (long) StrictMath.pow(5.0d, (double) attempt + 1.0d)
149+
);
148150
Logger.info(
149151
this,
150152
// @checkstyle LineLength (1 line)

0 commit comments

Comments
 (0)