program finalizat
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import {DirectoryWatcher} from "../helpers/directory_watcher";
|
||||
import {workerData} from "worker_threads";
|
||||
|
||||
const {
|
||||
memoryManagerPath,
|
||||
applicationInfoPath,
|
||||
} = workerData;
|
||||
|
||||
const backupDirectoryManager = new DirectoryWatcher(memoryManagerPath, applicationInfoPath, 'backupDirectory');
|
||||
const departmentShareManager = new DirectoryWatcher(memoryManagerPath, applicationInfoPath, 'departmentDirectory');
|
||||
const shareFileManager = new DirectoryWatcher(memoryManagerPath, applicationInfoPath, 'shareDirectory');
|
||||
|
||||
// Backup directory manager check loop
|
||||
const backupIntervalId = setInterval(async () => {
|
||||
if (await backupDirectoryManager.initialize()) {
|
||||
clearInterval(backupIntervalId); // Stop the loop once initialized
|
||||
console.log('BackupDirectoryManager successfully initialized.');
|
||||
} else {
|
||||
console.log('Retrying BackupDirectoryManager initialization...');
|
||||
}
|
||||
}, 10000); // Check every 60 seconds
|
||||
|
||||
|
||||
// Department share manager check loop
|
||||
const departmentIntervalId = setInterval(async () => {
|
||||
if (await departmentShareManager.initialize()) {
|
||||
clearInterval(departmentIntervalId); // Stop the loop once initialized
|
||||
console.log('DepartmentShareManager successfully initialized.');
|
||||
} else {
|
||||
console.log('Retrying DepartmentShareManager initialization...');
|
||||
}
|
||||
}, 10000); // Check every 60 seconds
|
||||
|
||||
// Department share manager check loop
|
||||
const shareIntervalId = setInterval(async () => {
|
||||
if (await shareFileManager.initialize()) {
|
||||
clearInterval(shareIntervalId); // Stop the loop once initialized
|
||||
console.log('DepartmentShareManager successfully initialized.');
|
||||
} else {
|
||||
console.log('Retrying DepartmentShareManager initialization...');
|
||||
}
|
||||
}, 10000); // Check every 60 seconds
|
||||
|
||||
Reference in New Issue
Block a user