🔧 Reverting to .on from .once for chokidar handlers

This commit is contained in:
2022-04-17 23:44:00 -07:00
parent 61b5c1cc40
commit 38a80e41b3

View File

@@ -83,8 +83,6 @@ export default class ApiService extends Service {
methods: {}, methods: {},
started(): any { started(): any {
// Filewatcher // Filewatcher
const fileWatcher = chokidar.watch( const fileWatcher = chokidar.watch(
path.resolve("/comics"), path.resolve("/comics"),
@@ -138,7 +136,7 @@ export default class ApiService extends Service {
}; };
fileWatcher fileWatcher
.once("add", (path, stats) => { .on("add", (path, stats) => {
console.log("Watcher detected new files."); console.log("Watcher detected new files.");
console.log( console.log(
`File ${path} has been added with stats: ${JSON.stringify( `File ${path} has been added with stats: ${JSON.stringify(
@@ -173,13 +171,13 @@ export default class ApiService extends Service {
// )}` // )}`
// ) // )
// ) // )
.once( .on(
"unlink", "unlink",
(path) => (path) =>
console.log(`File ${path} has been removed`) console.log(`File ${path} has been removed`)
) )
.once( .on(
"addDir", "addDir",
(path) => (path) =>