Skip to content

Commit

Permalink
bugfix: 滚动执行,每一批次都会全量执行所有主机的任务 TencentBlueKing#1241
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Aug 31, 2022
1 parent ca24bad commit 17b9cb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static com.tencent.bk.job.common.constant.Order.DESCENDING;
Expand Down Expand Up @@ -320,6 +321,10 @@ private AgentTaskDTO extract(Record record) {

@Override
public List<AgentTaskDTO> listAgentTasksByGseTaskId(Long gseTaskId) {
if (gseTaskId == null || gseTaskId <= 0) {
return Collections.emptyList();
}

List<AgentTaskDTO> agentTaskList = new ArrayList<>();

Result<?> result = CTX.select(ALL_FIELDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static com.tencent.bk.job.common.constant.Order.DESCENDING;
Expand Down Expand Up @@ -331,6 +332,10 @@ private AgentTaskDTO extract(Record record) {

@Override
public List<AgentTaskDTO> listAgentTasksByGseTaskId(Long gseTaskId) {
if (gseTaskId == null || gseTaskId <= 0) {
return Collections.emptyList();
}

List<AgentTaskDTO> agentTaskList = new ArrayList<>();

Result<?> result = CTX.select(ALL_FIELDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private void saveGseAgentTasksForStartRollingStep(Long gseTaskId,
executeCount,
serverBatch.getBatch() == 1 ? executeCount : null,
serverBatch.getBatch(),
serverBatch.getBatch() == 1 ? gseTaskId : null,
serverBatch.getBatch() == 1 ? gseTaskId : 0,
serverBatch.getHosts(),
AgentTaskStatusEnum.WAITING)
);
Expand Down

0 comments on commit 17b9cb4

Please sign in to comment.