diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js index 4f86cc5ad02..f33b44fefec 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/services/influxdb/influxdbDatasource.js @@ -131,12 +131,14 @@ function (angular, _, kbn) { function retry(deferred, callback, delay) { return callback().then(undefined, function(reason) { - if (reason.status !== 0) { + if (reason.status !== 0 || reason.status >= 300) { 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); }); }