From cf7819ebce6b6285fa3174494e2e2eaa8322ed0d Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Tue, 24 Mar 2020 19:06:56 +0200 Subject: [PATCH] Don't retry metrics on 404 status code (#152) Signed-off-by: Jari Kolehmainen Signed-off-by: Cody Belcher --- src/main/routes/metrics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/routes/metrics.ts b/src/main/routes/metrics.ts index 51940956c6..90eecb6685 100644 --- a/src/main/routes/metrics.ts +++ b/src/main/routes/metrics.ts @@ -37,7 +37,7 @@ class MetricsRoute extends LensApi { ...queryParams } }).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 return loadMetrics(query); }