mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
lastEmpty session cursors.
This commit is contained in:
parent
0b5e064cab
commit
78e4c38264
@ -139,6 +139,8 @@ func (manager *WebSocketManagerCtx) Start() {
|
||||
ticker := time.NewTicker(500 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
||||
lastEmpty := false
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-manager.shutdown:
|
||||
@ -146,9 +148,15 @@ func (manager *WebSocketManagerCtx) Start() {
|
||||
case <-ticker.C:
|
||||
cursorsMap := manager.sessions.PopCursors()
|
||||
if len(cursorsMap) == 0 {
|
||||
if lastEmpty {
|
||||
continue
|
||||
}
|
||||
|
||||
lastEmpty = true
|
||||
} else {
|
||||
lastEmpty = false
|
||||
}
|
||||
|
||||
cursors := []message.SessionCursor{}
|
||||
for session, cursor := range cursorsMap {
|
||||
cursors = append(
|
||||
|
Loading…
Reference in New Issue
Block a user