Skip to content

Commit

Permalink
include nil reference check during retires
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimkk-moideen committed Feb 4, 2025
1 parent fb6d814 commit fc8cccf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions exporter/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ func getDIMMEndpoints(url, host string, client *retryablehttp.Client) (oem.Colle
for retryCount < 1 && resp.StatusCode == http.StatusNotFound {
time.Sleep(client.RetryWaitMin)
resp, err = common.DoRequest(client, req)
if err != nil {
return dimms, err
}
retryCount = retryCount + 1
}
if err != nil {
Expand Down Expand Up @@ -297,6 +300,9 @@ func getDriveEndpoint(url, host string, client *retryablehttp.Client) (oem.Gener
for retryCount < 3 && resp.StatusCode == http.StatusNotFound {
time.Sleep(client.RetryWaitMin)
resp, err = common.DoRequest(client, req)
if err != nil {
return drive, err
}
retryCount = retryCount + 1
}
if err != nil {
Expand Down Expand Up @@ -473,6 +479,9 @@ func getProcessorEndpoints(url, host string, client *retryablehttp.Client) (oem.
for retryCount < 3 && resp.StatusCode == http.StatusNotFound {
time.Sleep(client.RetryWaitMin)
resp, err = common.DoRequest(client, req)
if err != nil {
return processors, err
}
retryCount = retryCount + 1
}
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions plugins/nuova/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ func checkRaidController(url, host string, client *retryablehttp.Client) (bool,
for retryCount < 1 && resp.StatusCode == http.StatusNotFound {
time.Sleep(client.RetryWaitMin)
resp, err = common.DoRequest(client, req)
if err != nil {
return false, nil
}
retryCount = retryCount + 1
}
if err != nil {
Expand Down

0 comments on commit fc8cccf

Please sign in to comment.