Remove filename check for fs.watch

This commit is contained in:
softsimon 2020-07-16 00:55:41 +07:00
parent 5d396f031d
commit e6b5e94631

View File

@ -28,15 +28,13 @@ class Bisq {
let fsWait: NodeJS.Timeout | null = null; let fsWait: NodeJS.Timeout | null = null;
fs.watch(config.BSQ_BLOCKS_DATA_PATH, (event: string, filename: string) => { fs.watch(config.BSQ_BLOCKS_DATA_PATH, (event: string, filename: string) => {
if (filename) { if (fsWait) {
if (fsWait) { clearTimeout(fsWait);
clearTimeout(fsWait);
}
fsWait = setTimeout(() => {
console.log(`${filename} file change detected.`);
this.loadBisqDumpFile();
}, 1000);
} }
fsWait = setTimeout(() => {
console.log(`${filename} file change detected.`);
this.loadBisqDumpFile();
}, 1000);
}); });
setInterval(this.updatePrice.bind(this), 1000 * 60 * 60); setInterval(this.updatePrice.bind(this), 1000 * 60 * 60);