feat: 3.1.0

1. 修改404问题
This commit is contained in:
byteblogs168 2024-02-01 23:50:38 +08:00
parent b7ede1ccf0
commit 220119afaa
3 changed files with 11 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import com.aizuda.easy.retry.server.common.util.GraphUtils;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.graph.MutableGraph; import com.google.common.graph.MutableGraph;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -78,6 +79,9 @@ public class MutableGraphCache {
public static Set<Long> getBrotherNode(MutableGraph<Long> graph, Long nodeId) { public static Set<Long> getBrotherNode(MutableGraph<Long> graph, Long nodeId) {
Set<Long> predecessors = graph.predecessors(nodeId); Set<Long> predecessors = graph.predecessors(nodeId);
if (CollectionUtils.isEmpty(predecessors)) {
return Sets.newHashSet();
}
return graph.successors(predecessors.stream().findFirst().get()); return graph.successors(predecessors.stream().findFirst().get());
} }

View File

@ -98,13 +98,15 @@ public class WorkflowExecutorActor extends AbstractActor {
} }
Set<Long> brotherNode = MutableGraphCache.getBrotherNode(graph, taskExecute.getParentId()); Set<Long> brotherNode = MutableGraphCache.getBrotherNode(graph, taskExecute.getParentId());
Sets.SetView<Long> union = Sets.union(successors, brotherNode);
// 添加父节点为了判断父节点的处理状态 // 添加父节点为了判断父节点的处理状态
List<JobTaskBatch> allJobTaskBatchList = jobTaskBatchMapper.selectList(new LambdaQueryWrapper<JobTaskBatch>() List<JobTaskBatch> allJobTaskBatchList = jobTaskBatchMapper.selectList(new LambdaQueryWrapper<JobTaskBatch>()
.select(JobTaskBatch::getWorkflowTaskBatchId, JobTaskBatch::getWorkflowNodeId, .select(JobTaskBatch::getWorkflowTaskBatchId, JobTaskBatch::getWorkflowNodeId,
JobTaskBatch::getTaskBatchStatus, JobTaskBatch::getOperationReason) JobTaskBatch::getTaskBatchStatus, JobTaskBatch::getOperationReason)
.eq(JobTaskBatch::getWorkflowTaskBatchId, workflowTaskBatch.getId()) .eq(JobTaskBatch::getWorkflowTaskBatchId, workflowTaskBatch.getId())
.in(JobTaskBatch::getWorkflowNodeId, .in(JobTaskBatch::getWorkflowNodeId,
Sets.union(successors, Sets.newHashSet(taskExecute.getParentId(), brotherNode))) Sets.union(union, Sets.newHashSet(taskExecute.getParentId())))
); );
List<WorkflowNode> workflowNodes = workflowNodeMapper.selectList(new LambdaQueryWrapper<WorkflowNode>() List<WorkflowNode> workflowNodes = workflowNodeMapper.selectList(new LambdaQueryWrapper<WorkflowNode>()
@ -193,12 +195,14 @@ public class WorkflowExecutorActor extends AbstractActor {
List<JobTaskBatch> jobTaskBatches = jobTaskBatchMap.get(nodeId); List<JobTaskBatch> jobTaskBatches = jobTaskBatchMap.get(nodeId);
// 说明此节点未执行, 继续等待执行完成 // 说明此节点未执行, 继续等待执行完成
if (CollectionUtils.isEmpty(jobTaskBatches)) { if (CollectionUtils.isEmpty(jobTaskBatches)) {
EasyRetryLog.LOCAL.info("存在未完成的兄弟节点. [{}]", nodeId);
return Boolean.FALSE; return Boolean.FALSE;
} }
boolean isCompleted = jobTaskBatches.stream().anyMatch( boolean isCompleted = jobTaskBatches.stream().anyMatch(
jobTaskBatch -> JobTaskBatchStatusEnum.NOT_COMPLETE.contains(jobTaskBatch.getTaskBatchStatus())); jobTaskBatch -> JobTaskBatchStatusEnum.NOT_COMPLETE.contains(jobTaskBatch.getTaskBatchStatus()));
if (isCompleted) { if (isCompleted) {
EasyRetryLog.LOCAL.info("存在未完成的兄弟节点. [{}]", nodeId);
return Boolean.FALSE; return Boolean.FALSE;
} }
} }

View File

@ -4,8 +4,8 @@ const jobApi = {
jobPageList: '/job/page/list', jobPageList: '/job/page/list',
jobList: '/job/list', jobList: '/job/list',
jobDetail: '/job/', jobDetail: '/job/',
saveJob: '/job/', saveJob: '/job',
updateJob: '/job/', updateJob: '/job',
updateJobStatus: '/job/status', updateJobStatus: '/job/status',
delJob: '/job/', delJob: '/job/',
timeByCron: '/job/cron', timeByCron: '/job/cron',