()
| 298 | }); |
| 299 | |
| 300 | const handleClose = () => { |
| 301 | console.log(`[session ${token.slice(0, 8)}] WebSocket closed`); |
| 302 | const session = this.store.get(token); |
| 303 | // Only start grace if this WS is still the one attached to the session |
| 304 | if (session && session.ws === ws) { |
| 305 | this.store.startGrace(token, () => { |
| 306 | /* logged inside startGrace */ |
| 307 | }); |
| 308 | } |
| 309 | }; |
| 310 | |
| 311 | ws.on("close", handleClose); |
| 312 | ws.on("error", (err) => { |
nothing calls this directly
no test coverage detected