fix: re-added gcConnOnError, addcheck on send

This commit is contained in:
Paul 2023-04-10 17:09:57 +02:00
parent b99badcb87
commit 5da8a5c952

View File

@ -52,11 +52,11 @@ func HandleWSRR(c echo.Context, cfg *config.Config) error {
case "bootstrap":
log.Printf("bootstrap: %s\n", apievent.Hostname)
for index, value := range LISTENERS {
if index != apievent.Hostname {
if index != apievent.Hostname && value.ConnectionPS != nil {
err = websocket.Message.Send(value.ConnectionPS, msg)
if err != nil {
log.Println(err)
//gcConnOnError(ws)
gcConnOnError(ws)
}
}
}
@ -71,19 +71,23 @@ func HandleWSRR(c echo.Context, cfg *config.Config) error {
}
for _, value := range LISTENERS {
if value.ConnectionPS != nil {
err = websocket.Message.Send(value.ConnectionPS, msg)
if err != nil {
log.Println(err)
//gcConnOnError(ws)
gcConnOnError(ws)
}
}
}
log.Printf("ws: Inserted event")
case "init":
for _, value := range LISTENERS {
if value.ConnectionPS != nil {
err = websocket.Message.Send(value.ConnectionPS, msg)
if err != nil {
log.Println(err)
//gcConnOnError(ws)
gcConnOnError(ws)
}
}
}
default: