Skip to content

Commit

Permalink
fixup post review finalization
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 16, 2024
1 parent 7a54697 commit 902a90a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CountItems/masterProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ let waitingForPromScraping = false;
werelogs.configure(loggerConfig);
const log = new werelogs.Logger('S3Utils::CountItems::Master');

const prometheusPollingPeriod = Number.parseInt(process.env.PROMETHEUS_POLLING_PERIOD, 10) > 0
? Number.parseInt(process.env.PROMETHEUS_POLLING_PERIOD, 10)
: 30;
function tryParseInt(s, defaultValue) {
const v = Number.parseInt(s, 10);
return v > 0 ? v : defaultValue;
}

const prometheusPollingAttempts = Number.parseInt(process.env.PROMETHEUS_POLLING_ATTEMPTS, 10) > 0
? Number.parseInt(process.env.PROMETHEUS_POLLING_ATTEMPTS, 10)
: 5;
const prometheusPollingPeriod = tryParseInt(process.env.PROMETHEUS_POLLING_PERIOD, 30);

const prometheusPollingAttempts = tryParseInt(process.env.PROMETHEUS_POLLING_ATTEMPTS, 5);

const numWorkers = process.env.NUM_WORKERS && !Number.isNaN(process.env.NUM_WORKERS)
? Number.parseInt(process.env.NUM_WORKERS, 10)
Expand Down

0 comments on commit 902a90a

Please sign in to comment.