测试子线程

This commit is contained in:
wulin 2020-11-18 14:42:01 +08:00
parent 6d9aac7b61
commit 5b5e4caf6a

View File

@ -103,6 +103,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
@Autowired @Autowired
private DingtalkBusiness dingtalkBusiness; private DingtalkBusiness dingtalkBusiness;
List<Thread> threads = new ArrayList<>();
@ -807,9 +809,13 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
} }
private void initFlowRecordAnsy(List<ResultRecord> resultRecords){ private void initFlowRecordAnsy(List<ResultRecord> resultRecords){
if(resultRecords.size() > 0){
ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords); ThreadInitFlowRecord threadInitFlowRecord = new ThreadInitFlowRecord(resultRecords);
Thread thread = new Thread(threadInitFlowRecord); Thread thread = new Thread(threadInitFlowRecord);
thread.start(); thread.start();
threads.add(thread);
}
} }
public class ThreadInitFlowRecord implements Runnable{ public class ThreadInitFlowRecord implements Runnable{
@ -833,6 +839,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
} }
ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo); ch.qos.logback.classic.Logger.threadLocalNo.set(oldNo);
//threads.remove(this);
} }
} }
} }