upd: 暴力停止线程

This commit is contained in:
2025-04-16 21:00:45 +08:00
parent 557d1ab373
commit 4b2bbdeb86
2 changed files with 4 additions and 6 deletions
@@ -26,12 +26,8 @@ public class PipelineManage {
pipelineTaskPool.submitTask(pipelineId, () -> {
List<PipelineNodeVo> pipelineNodeVos = initialize();
for (PipelineNodeVo pipelineNodeVo : pipelineNodeVos) {
if (Thread.currentThread().isInterrupted()) {
log.info("流水线被强行终止...");
break;
}
executePipeline(pipelineId, pipelineNodeVo);
while (!Thread.currentThread().isInterrupted() && "running".equals(pipelineNodeVo.getExecuteStatus())) {
while ("running".equals(pipelineNodeVo.getExecuteStatus())) {
log.info("流水线执行中...");
ThreadUtil.safeSleep(2000);
}
@@ -216,7 +216,9 @@ public class PipelineTaskPool {
if (running.compareAndSet(true, false)) {
if (currentThread != null) {
currentThread.interrupt();
// currentThread.interrupt();
// 暴力停止线程
currentThread.stop();
}
return true;
}