线程中断注释掉

This commit is contained in:
even 2025-06-10 09:46:21 +08:00
parent df4770d908
commit d083c2be99
6 changed files with 25 additions and 13 deletions

View File

@ -95,8 +95,11 @@ public class PipelineRunContext extends BaseRunContext{
||ContextStateEnum.BAD_ENDING.equals(stateEnum) ||ContextStateEnum.BAD_ENDING.equals(stateEnum)
||ContextStateEnum.SKIP_TO.equals(stateEnum)) { ||ContextStateEnum.SKIP_TO.equals(stateEnum)) {
this.endTime=LocalDateTime.now(); this.endTime=LocalDateTime.now();
// 入库保存 if (!curr.equals(ContextStateEnum.HAPPY_ENDING)) {
contextManager.toHistory(getContextDef().getId()); // 入库保存
contextManager.toHistory(getContextDef().getId());
}
} }
} else { } else {
log.error("非法状态扭转直接忽略,{},{}",curr,stateEnum); log.error("非法状态扭转直接忽略,{},{}",curr,stateEnum);

View File

@ -149,7 +149,8 @@ public class ApplicationWorker extends HttpWorker {
append(context,message); append(context,message);
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-应用包审查分析节点执行失败"); throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-应用包审查分析节点执行失败");
} }
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
} }
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> applicationConfigInfo, File file) { private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> applicationConfigInfo, File file) {
@ -214,7 +215,8 @@ public class ApplicationWorker extends HttpWorker {
// 轮询间隔 5 // 轮询间隔 5
Thread.sleep(POLLING_INTERVAL); Thread.sleep(POLLING_INTERVAL);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
log.error("轮询被中断: " + e.getMessage()); log.error("轮询被中断: " + e.getMessage());
} }
currentPollingTimes++; currentPollingTimes++;

View File

@ -194,7 +194,8 @@ public class CodingWorker extends HttpWorker {
// 轮询间隔 5 // 轮询间隔 5
Thread.sleep(POLLING_INTERVAL); Thread.sleep(POLLING_INTERVAL);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
log.error("轮询被中断: " + e.getMessage()); log.error("轮询被中断: " + e.getMessage());
} }
currentPollingTimes++; currentPollingTimes++;

View File

@ -158,7 +158,8 @@ public class ScaBinaryWorker extends HttpWorker {
append(context,message); append(context,message);
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败"); throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
} }
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
} }
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaBinaryConfigInfo, File file) { private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaBinaryConfigInfo, File file) {
@ -224,7 +225,8 @@ public class ScaBinaryWorker extends HttpWorker {
// 轮询间隔 5 // 轮询间隔 5
Thread.sleep(POLLING_INTERVAL); Thread.sleep(POLLING_INTERVAL);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
log.error("轮询被中断: " + e.getMessage()); log.error("轮询被中断: " + e.getMessage());
} }
currentPollingTimes++; currentPollingTimes++;

View File

@ -155,7 +155,8 @@ public class ScaMirrorWorker extends HttpWorker {
append(context,message); append(context,message);
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败"); throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
} }
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
} }
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaMirrorConfigInfo, File file) { private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaMirrorConfigInfo, File file) {
@ -227,7 +228,8 @@ public class ScaMirrorWorker extends HttpWorker {
// 轮询间隔 5 // 轮询间隔 5
Thread.sleep(POLLING_INTERVAL); Thread.sleep(POLLING_INTERVAL);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
log.error("轮询被中断: " + e.getMessage()); log.error("轮询被中断: " + e.getMessage());
} }
currentPollingTimes++; currentPollingTimes++;

View File

@ -85,8 +85,8 @@ public class ScaSbomWorker extends HttpWorker {
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"目标文件不存在"); throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"目标文件不存在");
} }
TargetVersion targetVersion = targetVersionService.getById(pipeline.getTargetVersionId()); TargetVersion targetVersion = targetVersionService.getById(pipeline.getTargetVersionId());
filePath = targetVersion.getFilePath(); // filePath = targetVersion.getFilePath();
filePath = "C:\\Users\\admin\\Desktop\\新建文件夹\\dist.zip";
try { try {
@ -151,7 +151,8 @@ public class ScaSbomWorker extends HttpWorker {
append(context,message); append(context,message);
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败"); throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
} }
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
} }
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaSbomConfigInfo, File file) { private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaSbomConfigInfo, File file) {
@ -216,7 +217,8 @@ public class ScaSbomWorker extends HttpWorker {
// 轮询间隔 5 // 轮询间隔 5
Thread.sleep(POLLING_INTERVAL); Thread.sleep(POLLING_INTERVAL);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
toBadEnding();
log.error("轮询被中断: " + e.getMessage()); log.error("轮询被中断: " + e.getMessage());
} }
currentPollingTimes++; currentPollingTimes++;