Skip to content

Commit

Permalink
refactoring semaphore.NewWeighted() to errgroup.SetLimit()
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Dec 15, 2023
1 parent 3e60dff commit 6073b94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/backup/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func (b *Backuper) Download(backupName string, tablePattern string, partitions [
}
log.Debugf("prepare table SHADOW concurrent semaphore with concurrency=%d len(tableMetadataAfterDownload)=%d", b.cfg.General.DownloadConcurrency, len(tableMetadataAfterDownload))
dataGroup, dataCtx := errgroup.WithContext(ctx)
dataGroup.SetLimit(int(b.cfg.General.DownloadConcurrency))

for i, tableMetadata := range tableMetadataAfterDownload {
if tableMetadata.MetadataOnly {
Expand Down

0 comments on commit 6073b94

Please sign in to comment.