Skip to content

Commit

Permalink
bugfix: 二进制环境使用NFS作为存储后端时分发本地文件失败 TencentBlueKing#1779
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 authored and jsonwan committed Feb 28, 2023
1 parent 7f1bbd2 commit c512a0e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public void prepareLocalFilesAsync(
List<FileSourceDTO> fileSourceList,
LocalFilePrepareTaskResultHandler resultHandler
) {
fillLocalFileSourceHost(fileSourceList, stepInstanceId);

if (!JobConstants.FILE_STORAGE_BACKEND_ARTIFACTORY.equals(
localFileConfigForExecute.getStorageBackend()
)) {
Expand Down Expand Up @@ -117,6 +119,16 @@ public void prepareLocalFilesAsync(
task.execute();
}

private void fillLocalFileSourceHost(List<FileSourceDTO> fileSourceList, long stepInstanceId) {
fileSourceList.forEach(fileSourceDTO -> {
if (fileSourceDTO.getFileType() == TaskFileTypeEnum.LOCAL.getType() || fileSourceDTO.isLocalUpload()) {
fileSourceDTO.setServers(agentService.getLocalServersDTO());
}
});
// 更新本地文件任务内容
taskInstanceService.updateResolvedSourceFile(stepInstanceId, fileSourceList);
}

public void clearPreparedTmpFile(long stepInstanceId) {
// 本地文件暂不支持实时清理,依赖定时清理
}
Expand Down

0 comments on commit c512a0e

Please sign in to comment.