This commit is contained in:
Benjamin Toby
2025-02-04 13:42:30 +01:00
parent 8a1294a348
commit efcee1bb11
24 changed files with 100 additions and 23 deletions
+4 -1
View File
@@ -18,7 +18,7 @@ const path_1 = __importDefault(require("path"));
const child_process_1 = require("child_process");
const delay_1 = __importDefault(require("../../utils/delay"));
let timeout;
const UPDATE_TIMEOUT = 2000;
const UPDATE_TIMEOUT = 200;
function watchFolders(_a) {
return __awaiter(this, arguments, void 0, function* ({ folders, options, }) {
try {
@@ -79,8 +79,11 @@ function watchFolders(_a) {
sync({ dirPath, dirs, options });
yield (0, delay_1.default)();
fs_1.default.watch(dirPath, { recursive: true }, (evt, fileName) => {
if (global.SYNCING)
return;
clearTimeout(timeout);
timeout = setTimeout(() => {
global.SYNCING = true;
sync({ dirPath, dirs, options });
process.exit(1);
}, INTERVAL);