Fixing audit log to wait for confirm
Этот коммит содержится в:
@@ -195,22 +195,22 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogAudit(extraInfo string) {
|
func (c *Context) LogAudit(extraInfo string) {
|
||||||
go func() {
|
audit := &model.Audit{UserId: c.Session.UserId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId}
|
||||||
audit := &model.Audit{UserId: c.Session.UserId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId}
|
if r := <-Srv.Store.Audit().Save(audit); r.Err != nil {
|
||||||
<-Srv.Store.Audit().Save(audit)
|
c.LogError(r.Err)
|
||||||
}()
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
|
func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
|
||||||
|
|
||||||
go func() {
|
if len(c.Session.UserId) > 0 {
|
||||||
if len(c.Session.UserId) > 0 {
|
extraInfo = strings.TrimSpace(extraInfo + " session_user=" + c.Session.UserId)
|
||||||
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}
|
audit := &model.Audit{UserId: userId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId}
|
||||||
<-Srv.Store.Audit().Save(audit)
|
if r := <-Srv.Store.Audit().Save(audit); r.Err != nil {
|
||||||
}()
|
c.LogError(r.Err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogError(err *model.AppError) {
|
func (c *Context) LogError(err *model.AppError) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user