aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sockets.js')
-rw-r--r--lib/sockets.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index 366820e0..252ee552 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -100,10 +100,12 @@ app.register(async function(app) {
const existing = Object.keys(store.sockets[username]);
if (existing.length > 4) {
const p = existing.find(sid => sid !== id);
- store.sockets[username][p].send(JSON.stringify({ type: "logout" }));
+ store.sockets[username][p].send(
+ JSON.stringify({ type: "logout" })
+ );
setTimeout(() => {
if (store.sockets[username][p])
- store.sockets[username][p].close(code, "too many sockets");
+ store.sockets[username][p].close(code, "too many sockets");
}, 5000);
}
store.sockets[username][id] = ws;