fix: websocket connections unreliable
Constant disconnection and reconnection every couple minutes or less.
This commit is contained in:
@@ -38,9 +38,10 @@ func (c *Conn) ReadPump(ctx context.Context, hub *Hub) {
|
||||
_, data, err := c.ws.Read(ctx)
|
||||
if err != nil {
|
||||
if ctx.Err() != nil {
|
||||
slog.Info("websocket context cancelled", "connId", c.id, "humanId", c.humanID, "error", ctx.Err())
|
||||
return
|
||||
}
|
||||
slog.Debug("websocket read error", "connId", c.id, "error", err)
|
||||
slog.Info("websocket read error", "connId", c.id, "humanId", c.humanID, "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user