Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wennmo committed Mar 19, 2020
1 parent ff6cfa9 commit ed1308e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/EngineStatusFetcher.js
Expand Up @@ -42,12 +42,14 @@ class EngineStatusFetcher {
});
response.on('end', () => {
try {
let resp;
// If body starts with # treat it as Prometheus format else JSON
if (body.charAt(0) === '#') {
resolve(parsePrometheusTextFormat(body));
resp = parsePrometheusTextFormat(body);
} else {
resolve(JSON.parse(body));
resp = JSON.parse(body);
}
resolve(resp);
} catch (err) {
logger.warn(`Engine health check returned invalid response: ${err}`);
reject(err);
Expand Down

0 comments on commit ed1308e

Please sign in to comment.