PLT-5073 Improve performance of /channels/view endpoint (#4881)

* Improve performance of /channels/view endpoint

* Fix store unit test
Этот коммит содержится в:
Joram Wilander
2016-12-23 10:32:30 -05:00
коммит произвёл GitHub
родитель ffd6ccde2e
Коммит 217cdf447a
12 изменённых файлов: 74 добавлений и 63 удалений

Просмотреть файл

@@ -95,7 +95,7 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
// Update the LastViewAt only if the post does not have from_webhook prop set (eg. Zapier app)
if _, ok := post.Props["from_webhook"]; !ok {
if result := <-Srv.Store.Channel().UpdateLastViewedAt(post.ChannelId, c.Session.UserId); result.Err != nil {
if result := <-Srv.Store.Channel().UpdateLastViewedAt([]string{post.ChannelId}, c.Session.UserId); result.Err != nil {
l4g.Error(utils.T("api.post.create_post.last_viewed.error"), post.ChannelId, c.Session.UserId, result.Err)
}
}