Remove debounce (didnt need it)
This commit is contained in:
parent
12c15fc62d
commit
8a6a0d5510
5
index.js
5
index.js
|
@ -295,12 +295,11 @@ fs.readdirSync(process.env.CONFIG_PATH).forEach(file => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
var check;
|
|
||||||
const watchFiles = () => {
|
const watchFiles = () => {
|
||||||
fs.watch(process.env.CONFIG_PATH, (event, file) => {
|
fs.watch(process.env.CONFIG_PATH, (event, file) => {
|
||||||
clearTimeout(check); // Debounce
|
|
||||||
if (file.startsWith(".")) return; // Ignore hidden files
|
if (file.startsWith(".")) return; // Ignore hidden files
|
||||||
check = setTimeout(() => {
|
setTimeout(() => {
|
||||||
tmp = {}
|
tmp = {}
|
||||||
newContents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
newContents = fs.readFileSync(path.join(process.env.CONFIG_PATH, file)).toString()
|
||||||
switch (file) {
|
switch (file) {
|
||||||
|
|
Loading…
Reference in a new issue