修复重试逻辑
This commit is contained in:
parent
62cd5e2016
commit
ef6c164c0f
@ -80,7 +80,7 @@ public class WvpService {
|
|||||||
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
|
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
|
||||||
// 重试次数
|
// 重试次数
|
||||||
.withStopStrategy(StopStrategies.stopAfterAttempt(DEFAULT_RETRY_TIME))
|
.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))
|
.withRetryListener(defaultRetryListener(name))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ public class WvpService {
|
|||||||
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
|
.withWaitStrategy(WaitStrategies.fixedWait(DEFAULT_RETRY_WAIT_TIME, TimeUnit.SECONDS))
|
||||||
// 重试次数
|
// 重试次数
|
||||||
.withStopStrategy(StopStrategies.stopAfterAttempt(DEFAULT_RETRY_TIME))
|
.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))
|
.withRetryListener(defaultRetryListener(name))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user