summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-03 10:53:53 -0500
committerGitHub <noreply@github.com>2017-10-03 10:53:53 -0500
commit5e69ce099f521aa49fc267c62235c003eae530ff (patch)
treec7177e4cac419082753225819f62d07c8b5671e8 /api/user.go
parentbfe7955fb0c72bb6f3e0a1e0aaca70cff27d7ddc (diff)
downloadchat-5e69ce099f521aa49fc267c62235c003eae530ff.tar.gz
chat-5e69ce099f521aa49fc267c62235c003eae530ff.tar.bz2
chat-5e69ce099f521aa49fc267c62235c003eae530ff.zip
Goroutine wranglin (#7556)
* goroutine wranglin * synchronize WebConn.WritePump
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go12
1 files changed, 7 insertions, 5 deletions
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, "")