Skip to content

Commit 8f7cf57

Browse files
committed
update
1 parent 81a3463 commit 8f7cf57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/monitor/src/plugins/processes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const { execSync } = require('child_process');
22
const { log, ses } = require('../node-common')(['log', 'ses']);
33

4+
/** Grace period before starting alerting */
5+
const GRACE_PERIOD_MS = 1000 * 60 * 5;
6+
7+
const start = Date.now();
48
let notified = false;
59

610
/**
@@ -13,6 +17,12 @@ module.exports = async (args) => {
1317
if (!PROCESSES.length) throw new Error('No processes to monitor');
1418

1519
const stoppedProcesses = [];
20+
const now = Date.now();
21+
22+
if (now - start < GRACE_PERIOD_MS) {
23+
log.debug('Within processes.js GRACE_PERIOD');
24+
return;
25+
}
1626

1727
try {
1828
// Get processes

0 commit comments

Comments
 (0)