From 43a5ffe0116b753180b76adb182e0fd9df5a722b Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Wed, 13 Mar 2019 15:38:26 -0400 Subject: [PATCH] Fixed a bug where a wrong variable is used as the number of threads --- src/duplicacy_s3storage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/duplicacy_s3storage.go b/src/duplicacy_s3storage.go index 5f7d3e8..f205d8f 100644 --- a/src/duplicacy_s3storage.go +++ b/src/duplicacy_s3storage.go @@ -210,7 +210,7 @@ func (storage *S3Storage) DownloadFile(threadIndex int, filePath string, chunk * defer output.Body.Close() - _, err = RateLimitedCopy(chunk, output.Body, storage.DownloadRateLimit/len(storage.bucket)) + _, err = RateLimitedCopy(chunk, output.Body, storage.DownloadRateLimit/storage.numberOfThreads) return err } @@ -225,7 +225,7 @@ func (storage *S3Storage) UploadFile(threadIndex int, filePath string, content [ Bucket: aws.String(storage.bucket), Key: aws.String(storage.storageDir + filePath), ACL: aws.String(s3.ObjectCannedACLPrivate), - Body: CreateRateLimitedReader(content, storage.UploadRateLimit/len(storage.bucket)), + Body: CreateRateLimitedReader(content, storage.UploadRateLimit/storage.numberOfThreads), ContentType: aws.String("application/duplicacy"), }