BACKEND DONE FOR ALL APPS

This commit is contained in:
andrei-mihnea-cerbu
2024-10-21 18:34:45 +03:00
parent 4157ca9e7d
commit ab1eaec413
349 changed files with 17199 additions and 14015 deletions
@@ -0,0 +1,38 @@
import { workerData, parentPort } from 'worker_threads';
import { BackupRetrievalWorker} from '../helpers/backup_retrieval'; // Assuming the class is in the same folder
// Destructure the data passed from the WorkerManager
const {
userConfigPath,
applicationInfoPath,
clientPort,
destinationPath
}: {
userConfigPath: string,
applicationInfoPath: string,
clientPort: number,
destinationPath: string
} = workerData;
// Initialize the BackupRetrievalWorker
const backupRetrievalWorker = new BackupRetrievalWorker(
userConfigPath,
applicationInfoPath,
clientPort,
destinationPath
);
// Start the backup retrieval process
backupRetrievalWorker.start()
.then(() => {
parentPort?.postMessage({
success: true,
message: 'Backup retrieval completed successfully.'
});
})
.catch((error: any) => {
parentPort?.postMessage({
success: false,
message: `Backup retrieval failed: ${error.message}`
});
});