mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Don't retry on http status codes >= 300
These status codes are likely to be to be unretryable errors coming from influx (most likely bad queries)
This commit is contained in:
parent
f9ede4bae9
commit
6c006d0a78
@ -131,12 +131,14 @@ function (angular, _, kbn) {
|
|||||||
|
|
||||||
function retry(deferred, callback, delay) {
|
function retry(deferred, callback, delay) {
|
||||||
return callback().then(undefined, function(reason) {
|
return callback().then(undefined, function(reason) {
|
||||||
if (reason.status !== 0) {
|
if (reason.status !== 0 || reason.status >= 300) {
|
||||||
deferred.reject(reason);
|
deferred.reject(reason);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setTimeout(function() {
|
||||||
|
return retry(deferred, callback, Math.min(delay * 2, 30000));
|
||||||
|
}, delay);
|
||||||
}
|
}
|
||||||
setTimeout(function() {
|
|
||||||
return retry(deferred, callback, Math.min(delay * 2, 30000));
|
|
||||||
}, delay);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user