Skip to content

Commit

Permalink
Adding Commentts
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Protasio <[email protected]>
  • Loading branch information
alanprot committed Jul 11, 2022
1 parent 2fb39ca commit 05dad96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/objstore/objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func NopCloserWithSize(r io.Reader) io.ReadCloser {
func UploadDir(ctx context.Context, logger log.Logger, bkt Bucket, srcdir, dstdir string, options ...UploadOption) error {
df, err := os.Stat(srcdir)
opts := applyUploadOptions(options...)

// The derived Context is canceled the first time a function passed to Go returns a non-nil error or the first
// time Wait returns, whichever occurs first.
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(opts.concurrency)

Expand Down Expand Up @@ -334,6 +337,8 @@ func DownloadDir(ctx context.Context, logger log.Logger, bkt BucketReader, origi
}
opts := applyDownloadOptions(options...)

// The derived Context is canceled the first time a function passed to Go returns a non-nil error or the first
// time Wait returns, whichever occurs first.
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(opts.concurrency)

Expand Down

0 comments on commit 05dad96

Please sign in to comment.