diff options
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go')
| -rw-r--r-- | vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go index db5314d5f..79d0c1dc1 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-streaming.go @@ -210,9 +210,13 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN } objPart, err := c.uploadPart(ctx, p) if err != nil { - uploadedPartsCh <- uploadedPartRes{ + select { + case <-ctx.Done(): + case uploadedPartsCh <- uploadedPartRes{ Error: err, + }: } + // Exit the goroutine. return } @@ -221,10 +225,13 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN uploadReq.Part = objPart // Send successful part info through the channel. - uploadedPartsCh <- uploadedPartRes{ + select { + case <-ctx.Done(): + case uploadedPartsCh <- uploadedPartRes{ Size: objPart.Size, PartNum: uploadReq.PartNum, Part: uploadReq.Part, + }: } } }(partSize) |
