From ccda2181c1c0a02a3d9feeb47e40644ca043bb11 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 14 Aug 2020 00:54:33 +0900 Subject: [PATCH] =?UTF-8?q?GCS=E3=81=AB=E5=A4=A7=E3=81=8D=E3=81=84?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=BC=E3=83=89=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20Fix=20#6254=20(?= =?UTF-8?q?#6648)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/drive/add-file.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index 0e56d7a055..91bbace481 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -216,7 +216,9 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string, const s3 = getS3(meta); - const upload = s3.upload(params); + const upload = s3.upload(params, { + partSize: s3.endpoint?.hostname === 'storage.googleapis.com' ? 500 * 1024 * 1024 : 8 * 1024 * 1024 + }); const result = await upload.promise(); if (result) logger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);