diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2020-08-14 00:54:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-14 00:54:33 +0900 |
| commit | ccda2181c1c0a02a3d9feeb47e40644ca043bb11 (patch) | |
| tree | 69cb90ddd10257060a2734d0f517fd2b174f9921 /src | |
| parent | WIP: Improve admin dashboard (diff) | |
| download | sharkey-ccda2181c1c0a02a3d9feeb47e40644ca043bb11.tar.gz sharkey-ccda2181c1c0a02a3d9feeb47e40644ca043bb11.tar.bz2 sharkey-ccda2181c1c0a02a3d9feeb47e40644ca043bb11.zip | |
GCSに大きいファイルがアップロードできないのを修正 Fix #6254 (#6648)
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/drive/add-file.ts | 4 |
1 files changed, 3 insertions, 1 deletions
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}`); |