Skip to content

Commit

Permalink
Merge pull request #243 from grafana/409-retry
Browse files Browse the repository at this point in the history
Retry requests to gcom that 409
  • Loading branch information
gerboland authored Feb 28, 2024
2 parents e811d32 + 07537a5 commit c32a1d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/plugin/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ func doRequest(req *http.Request) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("read http response: %w", err)
}
if resp.StatusCode/100 != 2 {
if resp.StatusCode == 409 {
// Retry usually helps if this happens
return doRequest(req)
} else if resp.StatusCode/100 != 2 {
return respBody, fmt.Errorf("HTTP error %d", resp.StatusCode)
}
return respBody, nil
Expand Down

0 comments on commit c32a1d5

Please sign in to comment.