Fix SIGTERM handler not disconnecting gateway clients and leaving timeouts active

This commit is contained in:
Madeline
2023-01-26 14:29:33 +11:00
parent 1dcaa9f5f9
commit ac7a178f88
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -82,7 +82,11 @@ export class Server {
}
async stop() {
closeDatabase();
this.server.close();
this.ws.clients.forEach((x) => x.close());
this.ws.close(() => {
this.server.close(() => {
closeDatabase();
});
});
}
}