mirror of
https://github.com/smogon/pokemon-showdown-loginserver.git
synced 2026-03-21 17:34:38 -05:00
Don't set a file watcher on every request
This commit is contained in:
parent
fdfebd96e7
commit
69a34b72be
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user