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 удалений

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

@@ -1862,14 +1862,12 @@ func TestViewChannel(t *testing.T) {
}
view.PrevChannelId = ""
view.Time = 1234567890
if _, resp := Client.ViewChannel(view); resp.Error != nil {
t.Fatal(resp.Error)
}
view.PrevChannelId = "junk"
view.Time = 0
if _, resp := Client.ViewChannel(view); resp.Error != nil {
t.Fatal(resp.Error)
@@ -1878,6 +1876,8 @@ func TestViewChannel(t *testing.T) {
rdata := Client.Must(Client.GetChannel(th.BasicChannel.Id, "")).Data.(*model.ChannelData)
if rdata.Channel.TotalMsgCount != rdata.Member.MsgCount {
t.Log(rdata.Channel.Id)
t.Log(rdata.Member.UserId)
t.Log(rdata.Channel.TotalMsgCount)
t.Log(rdata.Member.MsgCount)
t.Fatal("message counts don't match")