Skip to content

Commit

Permalink
fix: panic in upstream client
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Mar 4, 2024
1 parent c5ccc55 commit 477a770
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion upstream/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ func (t *UpstreamClient) PushArtifacts(ctx context.Context, artifactID uuid.UUID
// Ping sends a ping message to the upstream
func (t *UpstreamClient) Ping(ctx context.Context) error {
resp, err := t.Client.R(ctx).QueryParam(AgentNameQueryParam, t.AgentName).Get("/ping")
if err != nil {
return err
}

if !resp.IsOK() {
return fmt.Errorf("upstream sent an unexpected response: %v", resp.StatusCode)
}

return err
return nil
}

// Push uploads the given push message to the upstream server.
Expand Down

0 comments on commit 477a770

Please sign in to comment.