Skip to content

Commit

Permalink
cli: move wg.Add(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirusu committed Mar 17, 2023
1 parent 219b760 commit afb7b1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/internal/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ func (d *initDoer) Do(ctx context.Context) error {

grpcStateLogCtx, grpcStateLogCancel := context.WithCancel(ctx)
defer grpcStateLogCancel()
wg.Add(1)
// Use same context as init here since they both run on the same connection
d.handleGRPCStateChanges(grpcStateLogCtx, &wg, conn)

Expand All @@ -265,6 +264,7 @@ func (d *initDoer) Do(ctx context.Context) error {
}

func (d *initDoer) handleGRPCStateChanges(ctx context.Context, wg *sync.WaitGroup, conn *grpc.ClientConn) {
wg.Add(1)
go func() {
defer wg.Done()
state := conn.GetState()
Expand Down

0 comments on commit afb7b1c

Please sign in to comment.