Skip to content

Commit

Permalink
🐛 Make sure to wait for the start command to be called before calling…
Browse files Browse the repository at this point in the history
… the cmd.Wait

Signed-off-by: Shawn Hurley <shawn@hurley.page>
  • Loading branch information
shawn-hurley committed Jan 31, 2025
1 parent 80e9439 commit 87e09c9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,15 @@ func (p *javaProvider) Init(ctx context.Context, log logr.Logger, config provide
}
}()

// This is used to make sure that we wait to call the cmd.Wait until
// Start has been called
wg.Wait()

// This will close the go routine above when wait has completed.
go func() {
waitErrorChannel <- cmd.Wait()
}()

wg.Wait()

rpc := jsonrpc2.NewConn(jsonrpc2.NewHeaderStream(stdout, stdin), log)

rpc.AddHandler(jsonrpc2.NewBackoffHandler(log))
Expand Down

0 comments on commit 87e09c9

Please sign in to comment.