diff --git a/src/dispatcher.ts b/src/dispatcher.ts index a131d96..412a3ce 100644 --- a/src/dispatcher.ts +++ b/src/dispatcher.ts @@ -68,12 +68,6 @@ export class Dispatcher { this.user = new User(this.session); this.opts = opts; this.cookies = Dispatcher.parseCookie(this.request.headers.cookie); - - fs.watchFile(Config.serverlist, (curr, prev) => { - if (curr.mtime > prev.mtime) { - Dispatcher.loadServers(); - } - }); } async executeActions() { const {act, body} = this.opts; @@ -261,4 +255,12 @@ export class Dispatcher { } return {}; } + + static { + fs.watchFile(Config.serverlist, (curr, prev) => { + if (curr.mtime > prev.mtime) { + Dispatcher.loadServers(); + } + }); + } }