From 4ca41bc3292f19bc8bf1cfa84a07a83c124c69bf Mon Sep 17 00:00:00 2001 From: Valentyna Bukhalova Date: Fri, 27 Sep 2024 22:44:56 +0200 Subject: [PATCH] fix --- internal/proxy/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/proxy/client.go b/internal/proxy/client.go index 46a31cc..5561ac1 100644 --- a/internal/proxy/client.go +++ b/internal/proxy/client.go @@ -158,7 +158,7 @@ func (c *Client) sendInitialRequest(stream cloudproxyv1alpha.CloudProxyAPI_Strea if err != nil { return fmt.Errorf("stream.Send: initial request %w", err) } - c.lastSeenReceive.Store(time.Now().UnixNano()) + c.lastSeenSend.Store(time.Now().UnixNano()) c.log.Info("Stream to castai started successfully") @@ -274,6 +274,7 @@ func (c *Client) receive(ctx context.Context, stream cloudproxyv1alpha.CloudProx return fmt.Errorf("stream.Recv: %w", err) } + c.lastSeenReceive.Store(time.Now().UnixNano()) c.log.Debugf("Handling message from castai") go c.handleMessage(stream.Context(), in, respCh) } @@ -285,7 +286,6 @@ func (c *Client) handleMessage(ctx context.Context, in *cloudproxyv1alpha.Stream return } - c.lastSeenReceive.Store(time.Now().UnixNano()) c.processConfigurationRequest(in) // skip processing http request if keep alive message.