Skip to content

Commit

Permalink
feat: 定时任务兼容不合法主机 TencentBlueKing#3305
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Nov 29, 2024
1 parent e5af8c5 commit fe09543
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ public abstract class AbstractResultHandleTask<T> implements ContinuousScheduled
*/
protected boolean gseV2Task;
/**
* 是否包含不可执行的执行对象
* 是否包含不可执行的目标执行对象
*/
protected boolean hasNoExecutableExecuteObject;
protected boolean hasNoExecutableTargetExecuteObject;
/**
* GSE 任务信息,用于日志输出
*/
Expand Down Expand Up @@ -265,9 +265,11 @@ protected AbstractResultHandleTask(EngineDependentServiceHolder engineDependentS
}
}

this.hasNoExecutableExecuteObject =
executeObjectTasks.stream().anyMatch(
executeObjectTask -> !executeObjectTask.getExecuteObject().isExecutable());
this.hasNoExecutableTargetExecuteObject =
executeObjectTasks.stream().
filter(ExecuteObjectTask::isTarget)
.anyMatch(executeObjectTask -> !executeObjectTask.getExecuteObject().isExecutable());
log.info("hasNoExecutableTargetExecuteObject: {}", hasNoExecutableTargetExecuteObject);
}

private String buildGseTaskInfo(Long jobInstanceId, GseTaskDTO gseTask) {
Expand Down Expand Up @@ -706,7 +708,7 @@ protected GseTaskExecuteResult analyseFinishedExecuteResult() {
* 任务是否包含不可执行的执行对象
*/
protected boolean containsNoExecutableExecuteObject() {
return this.hasNoExecutableExecuteObject;
return this.hasNoExecutableTargetExecuteObject;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ public FileResultHandleTask(EngineDependentServiceHolder engineDependentServiceH
!executeObjectTask.getExecuteObject().isExecutable());

log.info("InitFileResultHandleTask|stepInstanceId: {}|sourceExecuteObjectGseKeys: {}"
+ "|targetExecuteObjectGseKeys: {}|fileUploadTaskNumMap: {}|fileDownloadTaskNumMap: {}",
+ "|targetExecuteObjectGseKeys: {}|fileUploadTaskNumMap: {}|fileDownloadTaskNumMap: {}"
+ "|hasNoExecutableSourceExecuteObject: {}",
stepInstance.getId(), sourceExecuteObjectGseKeys, targetExecuteObjectGseKeys, fileUploadTaskNumMap,
fileDownloadTaskNumMap);
fileDownloadTaskNumMap, hasNoExecutableSourceExecuteObject);
}

private void initSrcFilesMap(Collection<JobFile> srcFiles) {
Expand Down Expand Up @@ -539,7 +540,7 @@ private GseTaskExecuteResult analyseExecuteResult() {

@Override
protected boolean containsNoExecutableExecuteObject() {
return this.hasNoExecutableExecuteObject || this.hasNoExecutableSourceExecuteObject;
return this.hasNoExecutableTargetExecuteObject || this.hasNoExecutableSourceExecuteObject;
}

private boolean isAllSourceExecuteObjectTasksDone() {
Expand Down

0 comments on commit fe09543

Please sign in to comment.