Updates
This commit is contained in:
@@ -4,7 +4,6 @@ import { execSync } from "child_process";
|
||||
import delay from "../../utils/delay";
|
||||
import { SyncFoldersFnParams, SyncFoldersSyncFnParams } from "../../types";
|
||||
|
||||
|
||||
export default async function watchFolders({
|
||||
folders,
|
||||
options,
|
||||
@@ -12,8 +11,12 @@ export default async function watchFolders({
|
||||
let timeout: any;
|
||||
const UPDATE_TIMEOUT = 200;
|
||||
|
||||
if (global.SYNCING) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const dirs = folders;
|
||||
const dirs = folders;
|
||||
|
||||
console.log(`Now handling ${dirs.length} Directories`);
|
||||
|
||||
@@ -93,7 +96,10 @@ export default async function watchFolders({
|
||||
timeout = setTimeout(() => {
|
||||
global.SYNCING = true;
|
||||
sync({ dirPath, dirs, options });
|
||||
process.exit(1);
|
||||
setTimeout(() => {
|
||||
global.SYNCING = false;
|
||||
process.exit(global.SYNC_SUCCESS_EXIT_CODE);
|
||||
}, 500);
|
||||
}, INTERVAL);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user