summaryrefslogtreecommitdiffstats
path: root/api/web_team_hub.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-17 14:45:50 -0800
committerCorey Hulen <corey@hulen.com>2015-07-17 14:45:50 -0800
commitd65f199e12b19676bfac5e315ee634a8d3f05b88 (patch)
tree5d32f8193910f4a644e17a2c9d389ea3e01dffc0 /api/web_team_hub.go
parentf1329787357544b1f4ecdf36586b93206d56832e (diff)
parent246d12aaf23fa3a2c23225b33a333effff76253b (diff)
downloadchat-d65f199e12b19676bfac5e315ee634a8d3f05b88.tar.gz
chat-d65f199e12b19676bfac5e315ee634a8d3f05b88.tar.bz2
chat-d65f199e12b19676bfac5e315ee634a8d3f05b88.zip
Merge pull request #185 from mattermost/mm-1348
fixes mm-1348 removing dependency on redis
Diffstat (limited to 'api/web_team_hub.go')
-rw-r--r--api/web_team_hub.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/api/web_team_hub.go b/api/web_team_hub.go
index 7c7981e76..7a63b84d1 100644
--- a/api/web_team_hub.go
+++ b/api/web_team_hub.go
@@ -6,8 +6,6 @@ package api
import (
l4g "code.google.com/p/log4go"
"github.com/mattermost/platform/model"
- "github.com/mattermost/platform/store"
- "strings"
)
type TeamHub struct {
@@ -43,43 +41,6 @@ func (h *TeamHub) Stop() {
}
func (h *TeamHub) Start() {
-
- pubsub := store.RedisClient().PubSub()
-
- go func() {
- defer func() {
- l4g.Debug("redis reader finished for teamId=%v", h.teamId)
- hub.Stop(h.teamId)
- }()
-
- l4g.Debug("redis reader starting for teamId=%v", h.teamId)
-
- err := pubsub.Subscribe(h.teamId)
- if err != nil {
- l4g.Error("Error while subscribing to redis %v %v", h.teamId, err)
- return
- }
-
- for {
- if payload, err := pubsub.ReceiveTimeout(REDIS_WAIT); err != nil {
- if strings.Contains(err.Error(), "i/o timeout") {
- if len(h.connections) == 0 {
- l4g.Debug("No active connections so sending stop %v", h.teamId)
- return
- }
- } else {
- return
- }
- } else {
- msg := store.GetMessageFromPayload(payload)
- if msg != nil {
- h.broadcast <- msg
- }
- }
- }
-
- }()
-
go func() {
for {
select {
@@ -110,7 +71,6 @@ func (h *TeamHub) Start() {
webCon.WebSocket.Close()
}
- pubsub.Close()
return
}
}