fix repeated submit task (#9323)

Co-authored-by: caishunfeng <534328519@qq.com>
dependabot/maven/org.springframework-spring-beans-5.3.18
caishunfeng 2022-04-02 14:06:35 +08:00 committed by GitHub
parent 9f84dbbda0
commit 40e44f6bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -109,10 +109,8 @@ public class TaskExecuteThreadPool extends ThreadPoolTaskExecutor {
if (multiThreadFilterMap.containsKey(taskExecuteThread.getKey())) {
return;
}
ListenableFuture future = this.submitListenable(() -> {
multiThreadFilterMap.put(taskExecuteThread.getKey(), taskExecuteThread);
taskExecuteThread.run();
});
multiThreadFilterMap.put(taskExecuteThread.getKey(), taskExecuteThread);
ListenableFuture future = this.submitListenable(taskExecuteThread::run);
future.addCallback(new ListenableFutureCallback() {
@Override
public void onFailure(Throwable ex) {

View File

@ -107,11 +107,9 @@ public class WorkflowExecuteThreadPool extends ThreadPoolTaskExecutor {
if (multiThreadFilterMap.containsKey(workflowExecuteThread.getKey())) {
return;
}
multiThreadFilterMap.put(workflowExecuteThread.getKey(), workflowExecuteThread);
int processInstanceId = workflowExecuteThread.getProcessInstance().getId();
ListenableFuture future = this.submitListenable(() -> {
multiThreadFilterMap.put(workflowExecuteThread.getKey(), workflowExecuteThread);
workflowExecuteThread.handleEvents();
});
ListenableFuture future = this.submitListenable(workflowExecuteThread::handleEvents);
future.addCallback(new ListenableFutureCallback() {
@Override
public void onFailure(Throwable ex) {