lastEmpty session cursors.
This commit is contained in:
parent
0b5e064cab
commit
78e4c38264
1 changed files with 9 additions and 1 deletions
|
|
@ -139,6 +139,8 @@ func (manager *WebSocketManagerCtx) Start() {
|
||||||
ticker := time.NewTicker(500 * time.Millisecond)
|
ticker := time.NewTicker(500 * time.Millisecond)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
|
lastEmpty := false
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-manager.shutdown:
|
case <-manager.shutdown:
|
||||||
|
|
@ -146,7 +148,13 @@ func (manager *WebSocketManagerCtx) Start() {
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
cursorsMap := manager.sessions.PopCursors()
|
cursorsMap := manager.sessions.PopCursors()
|
||||||
if len(cursorsMap) == 0 {
|
if len(cursorsMap) == 0 {
|
||||||
continue
|
if lastEmpty {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
lastEmpty = true
|
||||||
|
} else {
|
||||||
|
lastEmpty = false
|
||||||
}
|
}
|
||||||
|
|
||||||
cursors := []message.SessionCursor{}
|
cursors := []message.SessionCursor{}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue