inactive cursor length rewrite.

This commit is contained in:
Miroslav Šedivý 2021-10-26 22:35:38 +02:00
parent 78e4c38264
commit 1025eedc22

View File

@ -147,15 +147,12 @@ func (manager *WebSocketManagerCtx) Start() {
return
case <-ticker.C:
cursorsMap := manager.sessions.PopCursors()
if len(cursorsMap) == 0 {
if lastEmpty {
length := len(cursorsMap)
if length == 0 && lastEmpty {
continue
}
lastEmpty = true
} else {
lastEmpty = false
}
lastEmpty = length == 0
cursors := []message.SessionCursor{}
for session, cursor := range cursorsMap {