After reliable websockets were introduced,
we would keep pushing to a webConn even after
the client has disconnected. This would lead
to the websocket.slow/full and eventually
the disconnect messages which unnecessarily
confuse the admin.

We don't log them if the connection is inactive.

We use the active field and convert it to an atomic
to use more widely.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2023-08-16 11:03:05 +05:30
коммит произвёл GitHub
родитель 2ed0c6495b
Коммит 0e75982f2b
3 изменённых файлов: 28 добавлений и 24 удалений

Просмотреть файл

@@ -379,8 +379,8 @@ func TestHubConnIndexInactive(t *testing.T) {
wc1 := &WebConn{
Platform: th.Service,
UserId: model.NewId(),
active: true,
}
wc1.active.Store(true)
wc1.SetConnectionID("conn1")
wc1.SetSession(&model.Session{})
@@ -388,16 +388,16 @@ func TestHubConnIndexInactive(t *testing.T) {
wc2 := &WebConn{
Platform: th.Service,
UserId: model.NewId(),
active: true,
}
wc2.active.Store(true)
wc2.SetConnectionID("conn2")
wc2.SetSession(&model.Session{})
wc3 := &WebConn{
Platform: th.Service,
UserId: wc2.UserId,
active: false,
}
wc3.active.Store(false)
wc3.SetConnectionID("conn3")
wc3.SetSession(&model.Session{})