Fix
Signed-off-by: Мария Малыгина <m.malygina@yadro.com>
This commit is contained in:
parent
88ae8f47a3
commit
6b7a27df4f
1 changed files with 6 additions and 3 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -71,6 +72,8 @@ func (c *Client) Put(bucket, key string, payload goja.ArrayBuffer) PutResponse {
|
|||
return PutResponse{Success: true}
|
||||
}
|
||||
|
||||
const multipartUploadMinPartSize = 5 * 1024 * 1024 // 5MB
|
||||
|
||||
func (c *Client) Multipart(bucket, key string, objPartSize int, payload goja.ArrayBuffer, concurrency int) PutResponse {
|
||||
if objPartSize < multipartUploadMinPartSize {
|
||||
stats.Report(c.vu, objPutFails, 1)
|
||||
|
@ -78,10 +81,10 @@ func (c *Client) Multipart(bucket, key string, objPartSize int, payload goja.Arr
|
|||
}
|
||||
start := time.Now()
|
||||
uploader := manager.NewUploader(c.cli, func(u *manager.Uploader) {
|
||||
u.PartSize = objPartSize
|
||||
uploader.Concurrency = concurrency
|
||||
u.PartSize = int64(objPartSize)
|
||||
u.Concurrency = concurrency
|
||||
})
|
||||
result, err := uploader.Upload(context.TODO(), &s3.PutObjectInput{
|
||||
_, err := uploader.Upload(context.TODO(), &s3.PutObjectInput{
|
||||
Bucket: aws.String(bucket),
|
||||
Key: aws.String(key),
|
||||
Body: bytes.NewReader(payload.Bytes()),
|
||||
|
|
Loading…
Add table
Reference in a new issue