properly clear inactive cursors.

This commit is contained in:
Miroslav Šedivý 2022-03-27 00:26:11 +01:00
parent 81867d811b
commit 7d53e59945

View File

@ -344,6 +344,10 @@ func (manager *WebSocketManagerCtx) startInactiveCursors() {
case <-manager.shutdownInactiveCursors: case <-manager.shutdownInactiveCursors:
manager.logger.Info().Msg("stopping inactive cursors handler") manager.logger.Info().Msg("stopping inactive cursors handler")
manager.shutdownInactiveCursors = nil manager.shutdownInactiveCursors = nil
// remove last cursor entries and send empty message
_ = manager.sessions.PopCursors()
manager.sessions.InactiveCursorsBroadcast(event.SESSION_CURSORS, []message.SessionCursors{}, nil)
return return
case <-ticker.C: case <-ticker.C:
cursorsMap := manager.sessions.PopCursors() cursorsMap := manager.sessions.PopCursors()