From f35948555731100292c11c230ce51990afc0973d Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 27 Aug 2015 16:25:05 -0400 Subject: Change GetPostsSince limit to 1000 and only add updated posts to post list order. --- store/sql_post_store.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'store') diff --git a/store/sql_post_store.go b/store/sql_post_store.go index 4ea28507b..f083a07c9 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -291,7 +291,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel { WHERE (UpdateAt > :Time AND ChannelId = :ChannelId) - LIMIT 100) + LIMIT 1000) UNION (SELECT * @@ -307,7 +307,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel { WHERE UpdateAt > :Time AND ChannelId = :ChannelId - LIMIT 100) temp_tab)) + LIMIT 1000) temp_tab)) ORDER BY CreateAt DESC`, map[string]interface{}{"ChannelId": channelId, "Time": time}) @@ -319,7 +319,9 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel { for _, p := range posts { list.AddPost(p) - list.AddOrder(p.Id) + if p.UpdateAt > time { + list.AddOrder(p.Id) + } } result.Data = list -- cgit v1.2.3-1-g7c22