Fixing build
Этот коммит содержится в:
@@ -195,18 +195,22 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogAudit(extraInfo string) {
|
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}
|
go func() {
|
||||||
Srv.Store.Audit().Save(audit)
|
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) {
|
func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
|
||||||
|
|
||||||
if len(c.Session.UserId) > 0 {
|
go func() {
|
||||||
extraInfo = strings.TrimSpace(extraInfo + " session_user=" + c.Session.UserId)
|
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}
|
audit := &model.Audit{UserId: userId, IpAddress: c.IpAddress, Action: c.Path, ExtraInfo: extraInfo, SessionId: c.Session.AltId}
|
||||||
Srv.Store.Audit().Save(audit)
|
<-Srv.Store.Audit().Save(audit)
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) LogError(err *model.AppError) {
|
func (c *Context) LogError(err *model.AppError) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package model
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
l4g "code.google.com/p/log4go"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -93,6 +94,7 @@ func getCookie(name string, resp *http.Response) *http.Cookie {
|
|||||||
|
|
||||||
func (c *Client) Must(result *Result, err *AppError) *Result {
|
func (c *Client) Must(result *Result, err *AppError) *Result {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
l4g.Close()
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
package store
|
package store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
l4g "code.google.com/p/log4go"
|
||||||
"github.com/mattermost/platform/model"
|
"github.com/mattermost/platform/model"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StoreResult struct {
|
type StoreResult struct {
|
||||||
@@ -17,6 +19,8 @@ type StoreChannel chan StoreResult
|
|||||||
func Must(sc StoreChannel) interface{} {
|
func Must(sc StoreChannel) interface{} {
|
||||||
r := <-sc
|
r := <-sc
|
||||||
if r.Err != nil {
|
if r.Err != nil {
|
||||||
|
l4g.Close()
|
||||||
|
time.Sleep(time.Second)
|
||||||
panic(r.Err)
|
panic(r.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user