summaryrefslogtreecommitdiffstats
path: root/api/web_hub.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-08-04 09:25:37 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-08-04 13:25:37 -0400
commit59d971dc751b0414c5b38c9df4b552e45f5641be (patch)
treed8c39aa5d1fa67d41d89bdd37f699a8e7ca7af36 /api/web_hub.go
parentac90f5b38962c301318fff9118c4556537002941 (diff)
downloadchat-59d971dc751b0414c5b38c9df4b552e45f5641be.tar.gz
chat-59d971dc751b0414c5b38c9df4b552e45f5641be.tar.bz2
chat-59d971dc751b0414c5b38c9df4b552e45f5641be.zip
PLT-2899 adding clustering of app servers (#3682)
* PLT-2899 adding clustering of app servers * PLT-2899 base framework * PLT-2899 HA backend * PLT-2899 Fixing config file * PLT-2899 adding config syncing * PLT-2899 set System console to readonly when clustering enabled. * PLT-2899 Fixing publish API * PLT-2899 fixing strings
Diffstat (limited to 'api/web_hub.go')
-rw-r--r--api/web_hub.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/api/web_hub.go b/api/web_hub.go
index 455189f70..85aa01a6d 100644
--- a/api/web_hub.go
+++ b/api/web_hub.go
@@ -5,6 +5,8 @@ package api
import (
l4g "github.com/alecthomas/log4go"
+
+ "github.com/mattermost/platform/einterfaces"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
@@ -31,14 +33,30 @@ var hub = &Hub{
func Publish(message *model.WebSocketEvent) {
hub.Broadcast(message)
+
+ if einterfaces.GetClusterInterface() != nil {
+ einterfaces.GetClusterInterface().Publish(message)
+ }
+}
+
+func PublishSkipClusterSend(message *model.WebSocketEvent) {
+ hub.Broadcast(message)
}
func InvalidateCacheForUser(userId string) {
hub.invalidateUser <- userId
+
+ if einterfaces.GetClusterInterface() != nil {
+ einterfaces.GetClusterInterface().InvalidateCacheForUser(userId)
+ }
}
func InvalidateCacheForChannel(channelId string) {
hub.invalidateChannel <- channelId
+
+ if einterfaces.GetClusterInterface() != nil {
+ einterfaces.GetClusterInterface().InvalidateCacheForChannel(channelId)
+ }
}
func (h *Hub) Register(webConn *WebConn) {