!13 同一批次客户端重试任务上报根据幂等id去重

Merge pull request !13 from 左军林/hotfix_2.3.0_20231106
This commit is contained in:
byteblogs168 2023-11-06 13:26:20 +00:00 committed by Gitee
commit 41507d3e21
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -57,7 +57,8 @@ public abstract class AbstractGenerator implements TaskGenerator {
checkAndInitScene(taskContext);
List<TaskContext.TaskInfo> taskInfos = taskContext.getTaskInfos();
//客户端上报任务根据幂等id去重
List <TaskContext.TaskInfo> taskInfos= taskContext.getTaskInfos().stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TaskContext.TaskInfo::getIdempotentId))), ArrayList::new));
Set<String> idempotentIdSet = taskInfos.stream().map(TaskContext.TaskInfo::getIdempotentId).collect(Collectors.toSet());