Skip to content

Commit

Permalink
fixups post reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed May 15, 2024
1 parent 666005b commit 46e5f76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CountItems/masterProcess.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const werelogs = require('werelogs');
const { network } = require('arsenal');
const { reshapeExceptionError } = require('arsenal').errorUtils;
const { threshold, frequency } = require('../utils/constants');
const S3UtilsMongoClient = require('../utils/S3UtilsMongoClient');

const CountMaster = require('./CountMaster');
Expand All @@ -23,6 +22,14 @@ const loggerConfig = {
werelogs.configure(loggerConfig);
const log = new werelogs.Logger('S3Utils::CountItems::Master');

const frequency = process.env.PROMETHEUS_POLLING_FREQUENCY && !Number.isNaN(process.env.PROMETHEUS_POLLING_FREQUENCY)
? Number.parseInt(process.env.PROMETHEUS_POLLING_FREQUENCY, 10)
: 30;

const threshold = process.env.PROMETHEUS_POLLING_THRESHOLD && !Number.isNaN(process.env.PROMETHEUS_POLLING_THRESHOLD)
? Number.parseInt(process.env.PROMETHEUS_POLLING_THRESHOLD, 10)
: 5;

const numWorkers = process.env.NUM_WORKERS && !Number.isNaN(process.env.NUM_WORKERS)
? Number.parseInt(process.env.NUM_WORKERS, 10)
: 4;
Expand Down
2 changes: 0 additions & 2 deletions utils/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
MaxParallelLimit: 10,
frequency: 30,
threshold: 5,
};

0 comments on commit 46e5f76

Please sign in to comment.