Optimize event loop (#13193)

This commit is contained in:
Wenjun Ruan 2022-12-15 14:34:52 +08:00 committed by GitHub
parent 43e6ac32dd
commit be81b222d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -285,7 +285,7 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> {
stateEvents);
return;
}
int loopTimes = stateEvents.size();
int loopTimes = stateEvents.size() * 2;
for (int i = 0; i < loopTimes; i++) {
final StateEvent stateEvent = this.stateEvents.peek();
try {

View File

@ -133,7 +133,7 @@ public class WorkflowExecuteThreadPool extends ThreadPoolTaskExecutor {
public void onSuccess(Object result) {
try {
LoggerUtils.setWorkflowInstanceIdMDC(workflowExecuteThread.getProcessInstance().getId());
if (workflowExecuteThread.workFlowFinish()) {
if (workflowExecuteThread.workFlowFinish() && workflowExecuteThread.eventSize() == 0) {
stateWheelExecuteThread
.removeProcess4TimeoutCheck(workflowExecuteThread.getProcessInstance().getId());
processInstanceExecCacheManager.removeByProcessInstanceId(processInstanceId);