summary refs log tree commit diff
path: root/src/gateway/Server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/gateway/Server.ts')
-rw-r--r--src/gateway/Server.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gateway/Server.ts b/src/gateway/Server.ts
index 81e4b7f4..3eec5c8f 100644
--- a/src/gateway/Server.ts
+++ b/src/gateway/Server.ts
@@ -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();
+			});
+		});
 	}
 }