feat: 2.6.0

1. 定时任务支持重试次数为0
This commit is contained in:
byteblogs168 2024-01-21 18:29:00 +08:00
parent 0440e127ca
commit 05d024bf11
3 changed files with 6 additions and 4 deletions

View File

@ -214,8 +214,8 @@ public class RpcClientInvokeHandler implements InvocationHandler {
private Retryer<Result> buildResultRetryer() {
Retryer<Result> retryer = RetryerBuilder.<Result>newBuilder()
.retryIfException(throwable -> failRetry)
.withStopStrategy(StopStrategies.stopAfterAttempt(retryTimes))
.withWaitStrategy(WaitStrategies.fixedWait(retryInterval, TimeUnit.SECONDS))
.withStopStrategy(StopStrategies.stopAfterAttempt(retryTimes <= 0 ? 1 : retryTimes))
.withWaitStrategy(WaitStrategies.fixedWait(Math.max(retryInterval, 0), TimeUnit.SECONDS))
.withRetryListener(retryListener)
.build();
return retryer;

View File

@ -124,10 +124,12 @@ public class RequestClientActor extends AbstractActor {
}
private JobRpcClient buildRpcClient(RegisterNodeInfo registerNodeInfo, RealJobExecutorDTO realJobExecutorDTO) {
int maxRetryTimes = realJobExecutorDTO.getMaxRetryTimes();
return RequestBuilder.<JobRpcClient, Result>newBuilder()
.nodeInfo(registerNodeInfo)
.namespaceId(registerNodeInfo.getNamespaceId())
.failRetry(Boolean.TRUE)
.failRetry(maxRetryTimes > 0)
.retryTimes(realJobExecutorDTO.getMaxRetryTimes())
.retryInterval(realJobExecutorDTO.getRetryInterval())
.retryListener(new JobExecutorRetryListener(realJobExecutorDTO))

View File

@ -210,7 +210,7 @@
<a-col :lg="6" :md="12" :sm="24">
<a-form-item label="最大重试次数">
<a-input-number
:min="1"
:min="0"
v-decorator="[
'maxRetryTimes',
{