feat(sj_1.1.0-beta2): 修复查询工作流批次为null问题

This commit is contained in:
opensnail 2024-07-03 23:25:07 +08:00
parent b1daac79d0
commit 19590c5422
4 changed files with 9 additions and 9 deletions

View File

@ -111,7 +111,7 @@ public class ReduceActor extends AbstractActor {
if (Objects.nonNull(reduceTask.getWorkflowTaskBatchId())) {
WorkflowTaskBatch workflowTaskBatch = workflowTaskBatchMapper.selectOne(
new LambdaQueryWrapper<WorkflowTaskBatch>()
.select(WorkflowTaskBatch::getWfContext)
.select(WorkflowTaskBatch::getWfContext, WorkflowTaskBatch::getId)
.eq(WorkflowTaskBatch::getId, reduceTask.getWorkflowTaskBatchId())
);
wfContext = workflowTaskBatch.getWfContext();

View File

@ -226,7 +226,7 @@ public class WorkflowBatchHandler {
* 重新触发未执行成功的工作流节点
*
* @param workflowTaskBatchId 工作流批次
* @param workflowTaskBatch 工作流批次信息(若为null, 则会通过workflowTaskBatchId查询)
* @param workflowTaskBatch 工作流批次信息(若为null, 则会通过workflowTaskBatchId查询)
* @throws IOException
*/
public void recoveryWorkflowExecutor(Long workflowTaskBatchId, WorkflowTaskBatch workflowTaskBatch) throws IOException {
@ -342,7 +342,7 @@ public class WorkflowBatchHandler {
Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder()
.retryIfResult(result -> result.equals(Boolean.FALSE))
.retryIfException(ex -> true)
.withWaitStrategy(WaitStrategies.randomWait(1000, TimeUnit.MILLISECONDS))
.withWaitStrategy(WaitStrategies.randomWait(800, TimeUnit.MILLISECONDS, 2000, TimeUnit.MILLISECONDS))
// 重试3秒
.withStopStrategy(StopStrategies.stopAfterAttempt(3))
.withRetryListener(new RetryListener() {
@ -356,8 +356,8 @@ public class WorkflowBatchHandler {
}
}
SnailJobLog.LOCAL.info("第【{}】次尝试更新上下文. result:[{}] treadName:[{}]",
attempt.getAttemptNumber(), result, Thread.currentThread().getName());
SnailJobLog.LOCAL.info("第【{}】次尝试更新上下文.taskBatchIds:[{}] result:[{}] treadName:[{}] ",
attempt.getAttemptNumber(), taskBatchIds, result, Thread.currentThread().getName());
}
}).build();

View File

@ -100,7 +100,7 @@ public class MapTaskPostHttpRequestHandler extends PostHttpRequestHandler {
if (Objects.nonNull(mapTaskRequest.getWorkflowTaskBatchId())) {
WorkflowTaskBatch workflowTaskBatch = workflowTaskBatchMapper.selectOne(
new LambdaQueryWrapper<WorkflowTaskBatch>()
.select(WorkflowTaskBatch::getWfContext)
.select(WorkflowTaskBatch::getWfContext, WorkflowTaskBatch::getId)
.eq(WorkflowTaskBatch::getId, mapTaskRequest.getWorkflowTaskBatchId())
);
newWfContext = workflowTaskBatch.getWfContext();

View File

@ -197,9 +197,9 @@ public class WorkflowBatchServiceImpl implements WorkflowBatchService {
jobBatchResponseVO.setJobId(jobTask.getJobId());
}
// 只为前端展示提供
nodeInfo.setTaskBatchStatus(NOT_HANDLE_STATUS);
jobBatchResponseVO.setTaskBatchStatus(NOT_HANDLE_STATUS);
jobBatchResponseVO.setOperationReason(JobOperationReasonEnum.WORKFLOW_NODE_NO_REQUIRED.getReason());
// nodeInfo.setTaskBatchStatus(NOT_HANDLE_STATUS);
// jobBatchResponseVO.setTaskBatchStatus(NOT_HANDLE_STATUS);
// jobBatchResponseVO.setOperationReason(JobOperationReasonEnum.WORKFLOW_NODE_NO_REQUIRED.getReason());
nodeInfo.setJobBatchList(Lists.newArrayList(jobBatchResponseVO));
}
}