changed timeouts for connection cleanup

This commit is contained in:
Jan Prochazka
2022-11-13 11:59:57 +01:00
parent 6cca81f8f1
commit dc576e6ced
4 changed files with 10 additions and 8 deletions

View File

@@ -292,13 +292,15 @@ async function handleMessage({ msgtype, ...other }) {
function start() {
childProcessChecker();
lastPing = new Date().getTime();
setInterval(() => {
const time = new Date().getTime();
if (time - lastPing > 30_000) {
if (time - lastPing > 25_000) {
console.log('Session not alive, exiting');
process.exit(0);
}
}, 30_000);
}, 10_000);
process.on('message', async message => {
if (handleProcessCommunication(message)) return;