Skip to content

Commit

Permalink
feature: Job 支持容器执行 - 脚本任务 TencentBlueKing#2631
Browse files Browse the repository at this point in the history
修复执行日志 offset 不正确的问题
  • Loading branch information
wangyu096 committed Mar 1, 2024
1 parent 31ba038 commit 7f9bc68
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ public ServiceExecuteObjectScriptLogDTO buildScriptLog(StepInstanceBaseDTO stepI
int offset) {
if (stepInstance.isSupportExecuteObjectFeature()) {
return new ServiceExecuteObjectScriptLogDTO(
executeObject.getId(), content, contentSizeBytes, offset + contentSizeBytes);
executeObject.getId(), content, contentSizeBytes, offset);
} else {
// 兼容历史版本使用 hostId 的方式;发布完成并全量切换到执行对象特性之后,可删除这里的兼容代码
HostDTO host = executeObject.getHost();
return new ServiceExecuteObjectScriptLogDTO(host.getHostId(), host.toCloudIp(), host.toCloudIpv6(),
content, contentSizeBytes, offset + contentSizeBytes);
content, contentSizeBytes, offset);
}
}

Expand All @@ -164,7 +164,7 @@ public void batchWriteScriptLog(long jobCreateTime,
buildServiceExecuteObjectLogDTO(stepInstanceId, executeCount, batch, scriptLog);
logs.add(executeObjectLog);
accumulatedSize += scriptLog.getContentSizeBytes();
;

if (accumulatedSize > requestContentSizeThreshold) {
// 当达到阈值,保存当前积累的logs集合
request.setLogs(logs);
Expand Down

0 comments on commit 7f9bc68

Please sign in to comment.