diff options
author | =Corey Hulen <corey@hulen.com> | 2015-08-20 14:20:39 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-08-20 14:20:39 -0700 |
commit | 3f0ec24dc1c18a550913beba8e742e0dbb4c7b42 (patch) | |
tree | fb3fc64433b99f8819ca6abe51b2f37082956b51 /api | |
parent | 8b3bbc5fb9b293f281b13797c299e620b00bfdec (diff) | |
download | chat-3f0ec24dc1c18a550913beba8e742e0dbb4c7b42.tar.gz chat-3f0ec24dc1c18a550913beba8e742e0dbb4c7b42.tar.bz2 chat-3f0ec24dc1c18a550913beba8e742e0dbb4c7b42.zip |
Fixing build
Diffstat (limited to 'api')
-rw-r--r-- | api/context.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/api/context.go b/api/context.go index e3f279e90..e6439e977 100644 --- a/api/context.go +++ b/api/context.go @@ -195,18 +195,22 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (c *Context) LogAudit(extraInfo string) { - audit := &model.Audit{UserId: c.Session.UserId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId} - Srv.Store.Audit().Save(audit) + go func() { + audit := &model.Audit{UserId: c.Session.UserId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId} + <-Srv.Store.Audit().Save(audit) + }() } func (c *Context) LogAuditWithUserId(userId, extraInfo string) { - if len(c.Session.UserId) > 0 { - extraInfo = strings.TrimSpace(extraInfo + " session_user=" + c.Session.UserId) - } + go func() { + if len(c.Session.UserId) > 0 { + extraInfo = strings.TrimSpace(extraInfo + " session_user=" + c.Session.UserId) + } - audit := &model.Audit{UserId: userId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId} - Srv.Store.Audit().Save(audit) + audit := &model.Audit{UserId: userId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId} + <-Srv.Store.Audit().Save(audit) + }() } func (c *Context) LogError(err *model.AppError) { |