diff options
Diffstat (limited to 'app/web_conn.go')
-rw-r--r-- | app/web_conn.go | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/app/web_conn.go b/app/web_conn.go index 02c3b2642..5205ac2ee 100644 --- a/app/web_conn.go +++ b/app/web_conn.go @@ -17,10 +17,11 @@ import ( ) const ( - WRITE_WAIT = 30 * time.Second - PONG_WAIT = 100 * time.Second - PING_PERIOD = (PONG_WAIT * 6) / 10 - AUTH_TIMEOUT = 5 * time.Second + WRITE_WAIT = 30 * time.Second + PONG_WAIT = 100 * time.Second + PING_PERIOD = (PONG_WAIT * 6) / 10 + AUTH_TIMEOUT = 5 * time.Second + WEBCONN_MEMBER_CACHE_TIME = 1000 * 60 * 30 // 30 minutes ) type WebConn struct { @@ -198,15 +199,7 @@ func (webCon *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool { // Only report events to users who are in the channel for the event if len(msg.Broadcast.ChannelId) > 0 { - - // Only broadcast typing messages if less than 1K people in channel - if msg.Event == model.WEBSOCKET_EVENT_TYPING { - if Srv.Store.Channel().GetMemberCountFromCache(msg.Broadcast.ChannelId) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel { - return false - } - } - - if model.GetMillis()-webCon.LastAllChannelMembersTime > 1000*60*15 { // 15 minutes + if model.GetMillis()-webCon.LastAllChannelMembersTime > WEBCONN_MEMBER_CACHE_TIME { webCon.AllChannelMembers = nil webCon.LastAllChannelMembersTime = 0 } |