🔧 Reverting to .on from .once for chokidar handlers
This commit is contained in:
@@ -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) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user