mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
inactive cursor length rewrite.
This commit is contained in:
parent
78e4c38264
commit
1025eedc22
@ -147,15 +147,12 @@ func (manager *WebSocketManagerCtx) Start() {
|
|||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
cursorsMap := manager.sessions.PopCursors()
|
cursorsMap := manager.sessions.PopCursors()
|
||||||
if len(cursorsMap) == 0 {
|
|
||||||
if lastEmpty {
|
length := len(cursorsMap)
|
||||||
|
if length == 0 && lastEmpty {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
lastEmpty = length == 0
|
||||||
lastEmpty = true
|
|
||||||
} else {
|
|
||||||
lastEmpty = false
|
|
||||||
}
|
|
||||||
|
|
||||||
cursors := []message.SessionCursor{}
|
cursors := []message.SessionCursor{}
|
||||||
for session, cursor := range cursorsMap {
|
for session, cursor := range cursorsMap {
|
||||||
|
Loading…
Reference in New Issue
Block a user