* goroutine wranglin

* synchronize WebConn.WritePump
Этот коммит содержится в:
Chris
2017-10-03 10:53:53 -05:00
коммит произвёл GitHub
родитель bfe7955fb0
Коммит 5e69ce099f
26 изменённых файлов: 233 добавлений и 118 удалений

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

@@ -649,7 +649,9 @@ func addMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
go c.App.PostAddToChannelMessage(oUser, nUser, channel)
c.App.Go(func() {
c.App.PostAddToChannelMessage(oUser, nUser, channel)
})
c.App.UpdateChannelLastViewedAt([]string{id}, oUser.Id)
w.Write([]byte(cm.ToJson()))

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

@@ -141,7 +141,9 @@ func saveIsPinnedPost(c *Context, w http.ResponseWriter, r *http.Request, isPinn
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_EDITED, "", rpost.ChannelId, "", nil)
message.Add("post", rpost.ToJson())
go c.App.Publish(message)
c.App.Go(func() {
c.App.Publish(message)
})
c.App.InvalidateCacheForChannelPosts(rpost.ChannelId)

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

@@ -1081,7 +1081,7 @@ func updateMfa(c *Context, w http.ResponseWriter, r *http.Request) {
c.LogAudit("success - deactivated")
}
go func() {
c.App.Go(func() {
var user *model.User
var err *model.AppError
if user, err = c.App.GetUser(c.Session.UserId); err != nil {
@@ -1092,7 +1092,7 @@ func updateMfa(c *Context, w http.ResponseWriter, r *http.Request) {
if err := app.SendMfaChangeEmail(user.Email, activate, user.Locale, utils.GetSiteURL()); err != nil {
l4g.Error(err.Error())
}
}()
})
rdata := map[string]string{}
rdata["status"] = "ok"
@@ -1212,7 +1212,9 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
case model.OAUTH_ACTION_SIGNUP:
teamId := relayProps["team_id"]
if len(teamId) > 0 {
go c.App.AddDirectChannels(teamId, user)
c.App.Go(func() {
c.App.AddDirectChannels(teamId, user)
})
}
break
case model.OAUTH_ACTION_EMAIL_TO_SSO:
@@ -1221,11 +1223,11 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
c.LogAuditWithUserId(user.Id, "Revoked all sessions for user")
go func() {
c.App.Go(func() {
if err := app.SendSignInChangeEmail(user.Email, strings.Title(model.USER_AUTH_SERVICE_SAML)+" SSO", user.Locale, utils.GetSiteURL()); err != nil {
l4g.Error(err.Error())
}
}()
})
break
}
doLogin(c, w, r, user, "")

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

@@ -39,6 +39,5 @@ func connect(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.HubRegister(wc)
}
go wc.WritePump()
wc.ReadPump()
wc.Pump()
}