network chunk v20

This commit is contained in:
andrei-mihnea-cerbu
2024-11-13 17:23:21 +02:00
parent f95b67f93d
commit 9baec7a7cb
41 changed files with 714 additions and 392 deletions
@@ -20,3 +20,20 @@ const networkScanner = new NetworkScanner(
errorPage,
databaseResetPage
);
process.on('SIGTERM', async () => {
console.log('Received SIGTERM. Cleaning up...');
await cleanupAndExit();
});
process.on('SIGINT', async () => {
console.log('Received SIGINT. Cleaning up...');
await cleanupAndExit();
});
async function cleanupAndExit() {
networkScanner.stopAllIntervals();
console.log('Cleanup complete. Exiting.');
process.exit(0); // Exit with code 0 to indicate a clean exit
}