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
+23 -1
View File
@@ -25,4 +25,26 @@ const backupRetrievalWorker = new BackupRetrievalWorker(
);
// Start the backup retrieval process
backupRetrievalWorker.start();
backupRetrievalWorker.start().then(() => {
console.log('Backup retrieval process completed successfully.');
});
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() {
// Perform any cleanup, such as closing connections, saving data, etc.
// Example: if you have a server instance running, you may want to close it:
// await server.close();
console.log('Cleanup complete. Exiting.');
process.exit(0); // Exit with code 0 to indicate a clean exit
}