Updates
This commit is contained in:
Vendored
+1
@@ -7,6 +7,7 @@ const child_process_1 = require("child_process");
|
||||
const files_1 = __importDefault(require("./watch/files"));
|
||||
const folders_1 = __importDefault(require("./watch/folders"));
|
||||
const confFileProvidedJSON = process.argv[process.argv.length - 1];
|
||||
global.SYNCING = false;
|
||||
try {
|
||||
const configFileObject = JSON.parse(confFileProvidedJSON);
|
||||
console.log(`Running '${configFileObject.title}' ...`);
|
||||
|
||||
Vendored
+4
-1
@@ -70,13 +70,16 @@ function watchFiles(_a) {
|
||||
sync({ options, filePath, files });
|
||||
yield (0, delay_1.default)();
|
||||
fs_1.default.watchFile(filePath, {
|
||||
interval: interval || 500,
|
||||
interval: interval || 200,
|
||||
}, (curr, prev) => {
|
||||
if (global.SYNCING)
|
||||
return;
|
||||
const INTERVAL = (options === null || options === void 0 ? void 0 : options.interval)
|
||||
? options.interval
|
||||
: UPDATE_TIMEOUT;
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
global.SYNCING = true;
|
||||
sync({ options, filePath, files });
|
||||
process.exit(1);
|
||||
}, INTERVAL);
|
||||
|
||||
Vendored
+4
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user