network chunk v20
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user