This commit is contained in:
Rizky 2024-08-16 11:31:28 +07:00
parent 44f934b4b9
commit e165919ae9
1 changed files with 52 additions and 60 deletions

View File

@ -12,21 +12,10 @@ export class Watcher {
constructor(path: string, id_site: string) { constructor(path: string, id_site: string) {
this.init(path, id_site); this.init(path, id_site);
// watcher.subscribe(path, (err, events) => {
// console.log(events);
// });
// watch(
// path,
// {
// recursive: true,
// persistent: true,
// },
// async (event, filename) => {
// }
// );
} }
async init(path: string, id_site: string) { async init(path: string, id_site: string) {
try {
const broadcastLoading = async () => { const broadcastLoading = async () => {
const client_ids = user.active const client_ids = user.active
.findAll({ site_id: id_site }) .findAll({ site_id: id_site })
@ -82,6 +71,9 @@ export class Watcher {
} }
} }
}); });
} catch (e) {
console.error(e);
}
} }
async close() { async close() {