From 6d8f00aea37344b3f55c21c1372ea13f434abb05 Mon Sep 17 00:00:00 2001 From: tom twinkle Date: Thu, 31 Aug 2023 10:56:42 +0900 Subject: [PATCH] feat: awss3 DownloadFiles use PooledBufferedWriterReadFromProvider --- aws/awss3/awss3.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aws/awss3/awss3.go b/aws/awss3/awss3.go index 0b8912a..ccbc8fb 100644 --- a/aws/awss3/awss3.go +++ b/aws/awss3/awss3.go @@ -287,7 +287,10 @@ func DownloadFiles(ctx context.Context, region awsconfig.Region, bucketName Buck } uniqKeys := keys.Unique() - downloader := manager.NewDownloader(client) + option := func(d *manager.Downloader) { + d.BufferProvider = manager.NewPooledBufferedWriterReadFromProvider(5 * 1024 * 1024) + } + downloader := manager.NewDownloader(client, option) paths := make([]string, len(uniqKeys)) getFilePath := func(s3Key string) string {