Skip to content

Commit

Permalink
Fix an issue that could not be uploaded to GCS.
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaeh authored and mei23 committed Jul 19, 2020
1 parent ae6a703 commit 5c0070f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/drive/add-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,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 * 1014
});

const result = await upload.promise();
if (result) logger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);
Expand Down

0 comments on commit 5c0070f

Please sign in to comment.