From 32c9c4aec7f0d8b4db188db753df38cda905a4ac Mon Sep 17 00:00:00 2001 From: wangyu096 Date: Tue, 22 Aug 2023 12:15:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E5=88=86=E5=8F=91?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=B8=A5=E8=B0=A8=E6=A8=A1=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E7=9B=AE=E5=BD=95=E5=A6=82=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E4=BB=8D=E7=84=B6=E4=BC=9A=E8=A2=AB=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=9B=E5=BB=BA=20#2354?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tencent/bk/job/common/gse/v1/GseV1ApiClient.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/backend/commons/gse-sdk/src/main/java/com/tencent/bk/job/common/gse/v1/GseV1ApiClient.java b/src/backend/commons/gse-sdk/src/main/java/com/tencent/bk/job/common/gse/v1/GseV1ApiClient.java index dd4f00aac9..d0001484f2 100644 --- a/src/backend/commons/gse-sdk/src/main/java/com/tencent/bk/job/common/gse/v1/GseV1ApiClient.java +++ b/src/backend/commons/gse-sdk/src/main/java/com/tencent/bk/job/common/gse/v1/GseV1ApiClient.java @@ -405,7 +405,7 @@ public GseTaskResponse asyncTransferFile(TransferFileRequest request) { private List toV1CopyFileInfoRequest(TransferFileRequest request) { return request.getTasks().stream() .map(task -> buildCopyFileInfo(task, request.getUploadSpeed(), - request.getDownloadSpeed(), request.getTimeout())) + request.getDownloadSpeed(), request.getTimeout(), request.isAutoMkdir())) .collect(Collectors.toList()); } @@ -622,13 +622,18 @@ public GseTaskResponse terminateGseScriptTask(TerminateGseTaskRequest request) { /** * 构建 GSE 拷贝文件请求 * - * @param task 文件拷贝任务 + * @param task 文件拷贝任务 + * @param uploadSpeedLimit 上传限速,null 表示不限速 + * @param downloadSpeedLimit 下载限速,null 表示不限速 + * @param timeout 任务超时时间 + * @param autoMkdir 目标目录不存在,是否自动创建目录 * @return 拷贝文件请求 */ public api_copy_fileinfoV2 buildCopyFileInfo(FileTransferTask task, Integer uploadSpeedLimit, Integer downloadSpeedLimit, - Integer timeout) { + Integer timeout, + boolean autoMkdir) { api_copy_fileinfoV2 copyFileInfo = new api_copy_fileinfoV2(); api_base_file_info baseFileInfo = new api_base_file_info(); @@ -657,6 +662,7 @@ public api_copy_fileinfoV2 buildCopyFileInfo(FileTransferTask task, if (timeout != null) { copyFileInfo.setTimeout(timeout); } + copyFileInfo.setMkdirflag(autoMkdir ? 1 : 0); return copyFileInfo; }