Commit 13e4c829 authored by nanahira's avatar nanahira

change default partSize

parent 9863c81c
Pipeline #40973 passed with stages
in 2 minutes and 47 seconds
import { ConsoleLogger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import {
_Object,
DeleteObjectsCommand,
GetObjectCommand,
HeadObjectCommand,
......@@ -15,11 +14,6 @@ import { createHash } from 'crypto';
import internal from 'stream';
import { Upload } from '@aws-sdk/lib-storage';
export interface S3StreamUploadResult {
url: string;
object: _Object;
}
export class S3Service extends ConsoleLogger {
private getConfig(field: string) {
return this.config.get(`${this.servicePrefix}_${field}`) || this.config.get(field);
......@@ -176,6 +170,8 @@ export class S3Service extends ConsoleLogger {
Body: stream,
...extras,
},
queueSize: 4,
partSize: 16 * 1024 * 1024,
});
await upload.done();
const object = await this.s3.send(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment