refactor(websocket): remove unused broadcastToSession export
Remove the dead-code broadcastToSession function from server/plugins/websocket.js. It was exported but never imported or called anywhere in the codebase. Its dependencies (getSessionConnections, addSessionConnection, removeSessionConnection) remain since they are actively used for per-session connection tracking. Closes #40
This commit is contained in:
@@ -43,16 +43,6 @@ export function removeSessionConnection(sessionId, ws) {
|
||||
}
|
||||
}
|
||||
|
||||
export function broadcastToSession(sessionId, message) {
|
||||
const conns = getSessionConnections(sessionId)
|
||||
const data = JSON.stringify(message)
|
||||
for (const ws of conns) {
|
||||
if (ws.readyState === 1) { // OPEN
|
||||
ws.send(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default defineNitroPlugin((nitroApp) => {
|
||||
nitroApp.hooks.hook('ready', async () => {
|
||||
const server = nitroApp.h3App.server || nitroApp.h3App.nodeServer
|
||||
|
||||
Reference in New Issue
Block a user