From 6073b94f0b16195a20573205d2d36d82a3846906 Mon Sep 17 00:00:00 2001 From: Slach Date: Fri, 15 Dec 2023 16:16:06 +0400 Subject: [PATCH] refactoring `semaphore.NewWeighted()` to `errgroup.SetLimit()` --- pkg/backup/download.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/backup/download.go b/pkg/backup/download.go index ab14eb10..1bb5b23d 100644 --- a/pkg/backup/download.go +++ b/pkg/backup/download.go @@ -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 {