1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-01 00:08:24 +09:00

GCSに大きいファイルがアップロードできないのを修正 Fix #6254 (#6648)

This commit is contained in:
MeiMei 2020-08-14 00:54:33 +09:00 committed by GitHub
parent b5fe4ba9be
commit ccda2181c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,7 +216,9 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string,
const s3 = getS3(meta); 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(); const result = await upload.promise();
if (result) logger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`); if (result) logger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);