From f48c646208cb5227b8f6c6a5139bf9af66da802d Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Tue, 3 Jan 2017 11:45:45 -0500 Subject: Fixing should send event removing extra go channel creation (#4942) --- api/web_conn.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'api') diff --git a/api/web_conn.go b/api/web_conn.go index 3b991d449..2f5036922 100644 --- a/api/web_conn.go +++ b/api/web_conn.go @@ -200,13 +200,8 @@ func (webCon *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool { // Only broadcast typing messages if less than 1K people in channel if msg.Event == model.WEBSOCKET_EVENT_TYPING { - if result := <-Srv.Store.Channel().GetMemberCount(msg.Broadcast.ChannelId, true); result.Err != nil { - l4g.Error("webhub.shouldSendEvent: " + result.Err.Error()) + if Srv.Store.Channel().GetMemberCountFromCache(msg.Broadcast.ChannelId) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel { return false - } else { - if result.Data.(int64) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel { - return false - } } } -- cgit v1.2.3-1-g7c22