From 613654ee47b4e0bfa9f9b3e553fcbbcfebb0ab2a Mon Sep 17 00:00:00 2001 From: BornChanger Date: Fri, 27 Oct 2023 19:55:37 +0800 Subject: [PATCH] *: address comments for 2nd round Signed-off-by: BornChanger --- br/pkg/aws/ebs.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/br/pkg/aws/ebs.go b/br/pkg/aws/ebs.go index 0f88d5d0ca92a..cf5425e03be0d 100644 --- a/br/pkg/aws/ebs.go +++ b/br/pkg/aws/ebs.go @@ -291,12 +291,10 @@ func (e *EC2Session) EnableDataFSR(meta *config.EBSBasedBRMeta, targetAZ string) eg, _ := errgroup.WithContext(context.Background()) - workerPool := utils.NewWorkerPool(uint(len(snapshotsIDsMap)), "enable snapshot FSR") - for availableZone := range snapshotsIDsMap { targetAZ := availableZone - workerPool.ApplyOnErrorGroup(eg, func() error { - log.Info("enable fsr for snapshots", zap.String("available zone", availableZone)) + eg.Go(func() error { + log.Info("enable fsr for snapshots", zap.String("available zone", targetAZ)) resp, err := e.ec2.EnableFastSnapshotRestores(&ec2.EnableFastSnapshotRestoresInput{ AvailabilityZones: []*string{&targetAZ}, SourceSnapshotIds: snapshotsIDsMap[targetAZ], @@ -379,11 +377,9 @@ func (e *EC2Session) DisableDataFSR(snapshotsIDsMap map[string][]*string) error eg, _ := errgroup.WithContext(context.Background()) - workerPool := utils.NewWorkerPool(uint(len(snapshotsIDsMap)), "disable snapshot FSR") - for availableZone := range snapshotsIDsMap { targetAZ := availableZone - workerPool.ApplyOnErrorGroup(eg, func() error { + eg.Go(func() error { resp, err := e.ec2.DisableFastSnapshotRestores(&ec2.DisableFastSnapshotRestoresInput{ AvailabilityZones: []*string{&targetAZ}, SourceSnapshotIds: snapshotsIDsMap[targetAZ],