Skip to content

Commit

Permalink
fixed wait on send
Browse files Browse the repository at this point in the history
  • Loading branch information
ValyaB committed Sep 27, 2024
1 parent f1cc03f commit 55fb63d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/proxy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ func (c *Client) sendAndReceive(ctx context.Context, stream cloudproxyv1alpha.Cl
return err
})

eg.Go(func() error {
// send loop is separate because it can block on sending messages.
go func() {
err := c.send(egctx, stream, sendCh)
if err != nil {
c.log.Errorf("stopping send loop: %v", err)
c.log.Errorf("stopped send loop: %v", err)
}
return err
})
}()

err = eg.Wait()
if err != nil {
Expand Down

0 comments on commit 55fb63d

Please sign in to comment.