From bc802b4c6cffc079a0e6cf4d1164aef237183ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Ctvrtka?= <62988319+JiriCtvrtka@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:32:51 +0100 Subject: [PATCH] PMM-12632 Fix agent client response. (#2581) * PMM-12632 Fix agent client response. * PMM-12632 Required changes. --- agent/client/cache/cache.go | 9 +++------ agent/client/client.go | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agent/client/cache/cache.go b/agent/client/cache/cache.go index 37ff100a48..abd5805665 100644 --- a/agent/client/cache/cache.go +++ b/agent/client/cache/cache.go @@ -73,14 +73,11 @@ func (c *Cache) Send(resp *models.AgentResponse) error { *agentpb.JobProgress, *agentpb.StopJobResponse, *agentpb.CheckConnectionResponse, - *agentpb.JobResult: + *agentpb.JobResult, + *agentpb.ServiceInfoResponse: cache = c.prioritized - case *agentpb.AgentLogsResponse, - *agentpb.Pong, - *agentpb.SetStateResponse: - cache = c.unprioritized default: - return nil + cache = c.unprioritized } return cache.Send(resp) } diff --git a/agent/client/client.go b/agent/client/client.go index 405724951d..f6ba5547a7 100644 --- a/agent/client/client.go +++ b/agent/client/client.go @@ -969,7 +969,10 @@ func (c *Client) sendAndWaitResponse(msg agentpb.AgentRequestPayload) (agentpb.S } func (c *Client) send(msg *models.AgentResponse) { - c.cache.Send(msg) //nolint:errcheck + err := c.cache.Send(msg) + if err != nil { + c.l.Error(err) + } } // check interface.