This commit is contained in:
andrei-mihnea-cerbu
2024-04-25 15:38:59 +03:00
parent 1486a9b834
commit ae8d04a5d9
20 changed files with 42 additions and 7 deletions
+3 -3
View File
@@ -265,6 +265,7 @@ async function decryptDepartmentFilesToDirectory() {
await lockFile(loginDataPath);
await lockFile(usersConfigPath);
await lockFile(dirDepartmentPath);
await decryptFileInPlace(loginDataPath);
await decryptFileInPlace(usersConfigPath);
@@ -286,8 +287,7 @@ async function decryptDepartmentFilesToDirectory() {
await unlockFile(loginDataPath);
await unlockFile(usersConfigPath);
await removeDirectory(destinationDir);
await unlockFile(dirDepartmentPath);
for (const userId of users) {
const userDir = path.join(sourceDir, userId);
@@ -331,7 +331,7 @@ decryptAndGetServerIP(path.join(__dirname, '..', 'ipConfig.json')).then(ip => {
serverIp = ip;
});
const timeoutInterval = 7 * 60 * 1000 //minutes * seconds * miliseconds
const timeoutInterval = 1 * 10 * 1000 //minutes * seconds * miliseconds
setInterval(async () => {
await decryptDepartmentFilesToDirectory();