From 0ff582c5b9d37c170f0b11cb01b6a7d633a81ff9 Mon Sep 17 00:00:00 2001 From: Azareal Date: Sat, 20 Apr 2019 09:15:17 +1000 Subject: [PATCH] Stop WebSockets from thawing the topic list. --- common/ws_hub.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/ws_hub.go b/common/ws_hub.go index d542f361..1dfe9bad 100644 --- a/common/ws_hub.go +++ b/common/ws_hub.go @@ -73,6 +73,11 @@ func (hub *WsHubImpl) Tick() error { } func wsTopicListTick(hub *WsHubImpl) error { + // Avoid hitting GetList when the topic list hasn't changed + if !TopicListThaw.Thawed() && hub.lastTopicList != nil { + return nil + } + // Don't waste CPU time if nothing has happened // TODO: Get a topic list method which strips stickies? tList, _, _, err := TopicList.GetList(1, "", nil)