remove remaining Global() calls (outside of tests) (#7521)

Этот коммит содержится в:
Chris
2017-09-27 11:52:34 -05:00
коммит произвёл Saturnino Abril
родитель 1bd66589a2
Коммит 8c80cdde38
45 изменённых файлов: 207 добавлений и 222 удалений

Просмотреть файл

@@ -226,7 +226,7 @@ func Init(a *app.App, root *mux.Router, full bool) *API {
if full {
utils.InitHTML()
app.InitEmailBatching()
a.InitEmailBatching()
}
return api

Просмотреть файл

@@ -61,10 +61,10 @@ func setupTestHelper(enterprise bool) *TestHelper {
th.App.NewServer()
th.App.InitStores()
th.App.Srv.Router = NewRouter()
wsapi.InitRouter()
th.App.Srv.WebSocketRouter = th.App.NewWebSocketRouter()
th.App.StartServer()
Init(th.App, th.App.Srv.Router, true)
wsapi.InitApi()
wsapi.Init(th.App, th.App.Srv.WebSocketRouter)
utils.EnableDebugLogForTest()
th.App.Srv.Store.MarkSystemRanUnitTests()

Просмотреть файл

@@ -8,7 +8,6 @@ import (
l4g "github.com/alecthomas/log4go"
"github.com/gorilla/websocket"
"github.com/mattermost/mattermost-server/app"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
)
@@ -38,7 +37,7 @@ func connectWebSocket(c *Context, w http.ResponseWriter, r *http.Request) {
wc := c.App.NewWebConn(ws, c.Session, c.T, "")
if len(c.Session.UserId) > 0 {
app.HubRegister(wc)
c.App.HubRegister(wc)
}
go wc.WritePump()