diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-20 13:12:19 -0600 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-20 13:12:19 -0600 |
commit | 0b1aff3b24b4ac2df8e963c83d6e52b127c603f9 (patch) | |
tree | 47735a3dd609e025837df4460b0d030454358cf1 /api/web_conn.go | |
parent | 1acd38b7b19521d06d274c42c00ce7072cd92196 (diff) | |
parent | 75f8729e2d25467500778e633c45c97e78a8f7a0 (diff) | |
download | chat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.tar.gz chat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.tar.bz2 chat-0b1aff3b24b4ac2df8e963c83d6e52b127c603f9.zip |
Merge pull request #1930 from mattermost/PLT-7-server-db
PLT-7 adding loc for db calls
Diffstat (limited to 'api/web_conn.go')
-rw-r--r-- | api/web_conn.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/api/web_conn.go b/api/web_conn.go index 2b0e29038..b9c728174 100644 --- a/api/web_conn.go +++ b/api/web_conn.go @@ -8,6 +8,7 @@ import ( "github.com/gorilla/websocket" "github.com/mattermost/platform/model" "github.com/mattermost/platform/store" + "github.com/mattermost/platform/utils" "time" ) @@ -29,8 +30,8 @@ type WebConn struct { func NewWebConn(ws *websocket.Conn, teamId string, userId string, sessionId string) *WebConn { go func() { - achan := Srv.Store.User().UpdateUserAndSessionActivity(userId, sessionId, model.GetMillis()) - pchan := Srv.Store.User().UpdateLastPingAt(userId, model.GetMillis()) + achan := Srv.Store.User().UpdateUserAndSessionActivity(utils.T, userId, sessionId, model.GetMillis()) + pchan := Srv.Store.User().UpdateLastPingAt(utils.T, userId, model.GetMillis()) if result := <-achan; result.Err != nil { l4g.Error("Failed to update LastActivityAt for user_id=%v and session_id=%v, err=%v", userId, sessionId, result.Err) @@ -55,7 +56,7 @@ func (c *WebConn) readPump() { c.WebSocket.SetReadDeadline(time.Now().Add(PONG_WAIT)) go func() { - if result := <-Srv.Store.User().UpdateLastPingAt(c.UserId, model.GetMillis()); result.Err != nil { + if result := <-Srv.Store.User().UpdateLastPingAt(utils.T, c.UserId, model.GetMillis()); result.Err != nil { l4g.Error("Failed to updated LastPingAt for user_id=%v, err=%v", c.UserId, result.Err) } }() @@ -107,7 +108,7 @@ func (c *WebConn) writePump() { } func (c *WebConn) updateChannelAccessCache(channelId string) bool { - allowed := hasPermissionsToChannel(Srv.Store.Channel().CheckPermissionsTo(c.TeamId, channelId, c.UserId)) + allowed := hasPermissionsToChannel(Srv.Store.Channel().CheckPermissionsTo(utils.T, c.TeamId, channelId, c.UserId)) c.ChannelAccessCache[channelId] = allowed return allowed |