diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/channel.go | 4 | ||||
-rw-r--r-- | api/post.go | 4 | ||||
-rw-r--r-- | api/user.go | 12 | ||||
-rw-r--r-- | api/websocket.go | 3 |
4 files changed, 14 insertions, 9 deletions
diff --git a/api/channel.go b/api/channel.go index 7222ba0b1..87fbf5d39 100644 --- a/api/channel.go +++ b/api/channel.go @@ -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())) diff --git a/api/post.go b/api/post.go index db9412e7b..b2b8e3d0e 100644 --- a/api/post.go +++ b/api/post.go @@ -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) diff --git a/api/user.go b/api/user.go index 5aeb2762b..1e77b8e2e 100644 --- a/api/user.go +++ b/api/user.go @@ -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, "") diff --git a/api/websocket.go b/api/websocket.go index c90968e7c..e5e2390c7 100644 --- a/api/websocket.go +++ b/api/websocket.go @@ -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() } |