summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-01-03 11:45:45 -0500
committerenahum <nahumhbl@gmail.com>2017-01-03 13:45:45 -0300
commitf48c646208cb5227b8f6c6a5139bf9af66da802d (patch)
tree99c53f9bf77f43705933c78e062061177b948aa5 /api
parentf94e220c88e2c233536f48ce42a2dfba8c3403b8 (diff)
downloadchat-f48c646208cb5227b8f6c6a5139bf9af66da802d.tar.gz
chat-f48c646208cb5227b8f6c6a5139bf9af66da802d.tar.bz2
chat-f48c646208cb5227b8f6c6a5139bf9af66da802d.zip
Fixing should send event removing extra go channel creation (#4942)
Diffstat (limited to 'api')
-rw-r--r--api/web_conn.go7
1 files changed, 1 insertions, 6 deletions
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
- }
}
}