Преглед на файлове

Merge pull request #1081 from kubecost/bolt/prom-response-nil-check

Prometheus Response Nil Check
Matt Bolt преди 4 години
родител
ревизия
8897aa09dc
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      pkg/prom/prom.go

+ 1 - 1
pkg/prom/prom.go

@@ -267,7 +267,7 @@ func (rlpc *RateLimitedPrometheusClient) worker() {
 			// * Check for a 429 StatusCode OR 400 StatusCode and message containing "ThrottlingException"
 			// * Attempt to parse a Retry-After from response headers (common on 429)
 			// * If we couldn't determine how long to wait for a retry, use 1 second by default
-			if retryRateLimit {
+			if res != nil && retryRateLimit {
 				var status []*RateLimitResponseStatus
 				var retries int = retryOpts.MaxRetries
 				var defaultWait time.Duration = retryOpts.DefaultRetryWait