1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

dont retry metrics on 404 status code

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-03-24 18:46:25 +02:00
parent 1aaa695cfe
commit 3a87fc2d3d

View File

@ -37,7 +37,7 @@ class MetricsRoute extends LensApi {
...queryParams ...queryParams
} }
}).catch(async (error) => { }).catch(async (error) => {
if (attempt < maxAttempts) { if (attempt < maxAttempts && (error.statusCode && error.statusCode != 404)) {
await new Promise(resolve => setTimeout(resolve, attempt * 1000)); // add delay before repeating request await new Promise(resolve => setTimeout(resolve, attempt * 1000)); // add delay before repeating request
return loadMetrics(query); return loadMetrics(query);
} }