diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-25 15:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-25 15:10:36 +0300 |
commit | f471d836199c3e35a80769a6daa5c4b6a52be8d7 (patch) | |
tree | 91f83fdf9b37eb49fa4baffa88b95867cd6233e7 /workhorse/internal/upload/destination | |
parent | 919f0e86ba5997120d02601e648543d1682e8260 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse/internal/upload/destination')
-rw-r--r-- | workhorse/internal/upload/destination/objectstore/gocloud_object.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/workhorse/internal/upload/destination/objectstore/gocloud_object.go b/workhorse/internal/upload/destination/objectstore/gocloud_object.go index 38545086994..2c7282e8e96 100644 --- a/workhorse/internal/upload/destination/objectstore/gocloud_object.go +++ b/workhorse/internal/upload/destination/objectstore/gocloud_object.go @@ -42,10 +42,15 @@ func NewGoCloudObject(p *GoCloudObjectParams) (*GoCloudObject, error) { return o, nil } +const ChunkSize = 5 * 1024 * 1024 + func (o *GoCloudObject) Upload(ctx context.Context, r io.Reader) error { defer o.bucket.Close() - writer, err := o.bucket.NewWriter(ctx, o.objectName, nil) + writerOptions := &blob.WriterOptions{ + BufferSize: ChunkSize, + } + writer, err := o.bucket.NewWriter(ctx, o.objectName, writerOptions) if err != nil { log.ContextLogger(ctx).WithError(err).Error("error creating GoCloud bucket") return err |