fixed a couple of issues flagged by coderabbit

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
Dmitri Dolguikh
2026-07-01 16:43:53 +02:00
parent b684f8570a
commit fb22695894
3 changed files with 10 additions and 6 deletions

View File

@@ -109,7 +109,7 @@ func (c *GRPCClient) Close() error {
func (c *GRPCClient) Send(event *proto.FlowEvent) error {
c.mu.Lock()
stream := c.stream
c.mu.Unlock()
defer c.mu.Unlock() // stream.Send() is not safe to call concurrently from multiple goroutines
if stream == nil {
return errors.New("stream not initialized")