fix: gcConnOnError

This commit is contained in:
Paul 2023-04-10 16:53:53 +02:00
parent 77919b208f
commit 1802abe553

View File

@ -46,7 +46,8 @@ func WelcomeAgents(ws *websocket.Conn, welcome WSWelcome, t string) {
func gcConnOnError(ws *websocket.Conn) (err error) { func gcConnOnError(ws *websocket.Conn) (err error) {
for index, value := range LISTENERS { for index, value := range LISTENERS {
if value.ConnectionPS == ws || value.ConnectionRR == ws { if value.ConnectionPS == ws || value.ConnectionRR == ws {
ws.Close() value.ConnectionPS.Close()
value.ConnectionRR.Close()
delete(LISTENERS, index) delete(LISTENERS, index)
} }
} }