Skip to content

Commit

Permalink
making wg to work with each proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-bansal committed Jan 5, 2021
1 parent f733120 commit d1f39f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/online_restore_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ func ProcessRestoreRequest(ctx context.Context, req *pb.RestoreRequest, wg *sync

// TODO: prevent partial restores when proposeRestoreOrSend only sends the restore
// request to a subset of groups.
wg.Add(1)
errCh := make(chan error, len(currentGroups))
for _, gid := range currentGroups {
reqCopy := proto.Clone(req).(*pb.RestoreRequest)
reqCopy.GroupId = gid
wg.Add(1)
go func() {
errCh <- tryRestoreProposal(ctx, reqCopy)
}()
Expand All @@ -108,8 +108,8 @@ func ProcessRestoreRequest(ctx context.Context, req *pb.RestoreRequest, wg *sync
if err := <-errCh; err != nil {
glog.Errorf("Error while restoring %v", err)
}
wg.Done()
}
wg.Done()
}()

return nil
Expand Down

0 comments on commit d1f39f4

Please sign in to comment.