Skip to content

Commit

Permalink
PMM-12632 Fix agent client response. (#2581)
Browse files Browse the repository at this point in the history
* PMM-12632 Fix agent client response.

* PMM-12632 Required changes.
  • Loading branch information
JiriCtvrtka authored Oct 30, 2023
1 parent 1d326ec commit bc802b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 3 additions & 6 deletions agent/client/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
5 changes: 4 additions & 1 deletion agent/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bc802b4

Please sign in to comment.