修复重试逻辑

This commit is contained in:
shikong 2023-09-09 23:03:54 +08:00
parent 62cd5e2016
commit ef6c164c0f

View File

@ -80,7 +80,7 @@ public class WvpService {
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
// 重试次数
.withStopStrategy(StopStrategies.stopAfterAttempt(DEFAULT_RETRY_TIME))
.retryIfResult(result -> result != null && (result.getCode() != 0 || result.getCode() != 200))
.retryIfResult(result -> result == null || (result.getCode() != 0 && result.getCode() != 200))
.withRetryListener(defaultRetryListener(name))
.build();
}
@ -95,7 +95,7 @@ public class WvpService {
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
// 重试次数
.withStopStrategy(StopStrategies.stopAfterAttempt(DEFAULT_RETRY_TIME))
.retryIfResult(result -> result != null && (result.getCode() != 0 || result.getCode() != 200))
.retryIfResult(result -> result == null || (result.getCode() != 0 && result.getCode() != 200))
.withRetryListener(defaultRetryListener(name))
.build();
}