Skip to content

Commit 650db9e

Browse files
placazeliran2000
andauthored
fix(#2105): Retry mechanism without delay causing failures (#2108)
Co-authored-by: Liran M <[email protected]>
1 parent 9c419c6 commit 650db9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/IntervalCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void start() {
8080
this.subscription = Flux.interval(this.interval)
8181
.doOnSubscribe((s) -> log.debug("Scheduled {}-check every {}", this.name, this.interval))
8282
.log(log.getName(), Level.FINEST).subscribeOn(this.scheduler).concatMap((i) -> this.checkAllInstances())
83-
.retryWhen(Retry.indefinitely()
83+
.retryWhen(Retry.backoff(Long.MAX_VALUE, Duration.ofSeconds(1))
8484
.doBeforeRetry((s) -> log.warn("Unexpected error in {}-check", this.name, s.failure())))
8585
.subscribe();
8686
}

spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/IntervalCheckTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void should_check_after_error() throws InterruptedException {
8888
when(this.checkFn.apply(any())).thenReturn(Mono.error(new RuntimeException("Test"))).thenReturn(Mono.empty());
8989

9090
this.intervalCheck.start();
91-
Thread.sleep(100);
91+
Thread.sleep(1500);
9292
verify(this.checkFn, atLeast(2)).apply(InstanceId.of("Test"));
9393
}
9494

0 commit comments

Comments
 (0)