Skip to content

Commit

Permalink
Don't retry metrics on 404 status code (#152)
Browse files Browse the repository at this point in the history
Signed-off-by: Jari Kolehmainen <[email protected]>
  • Loading branch information
jakolehm authored Mar 24, 2020
1 parent 1aaa695 commit 39fdcdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/routes/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 39fdcdb

Please sign in to comment.