diff options
author | Corey Hulen <corey@hulen.com> | 2015-08-27 15:59:00 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-08-27 15:59:00 -0700 |
commit | 088065206b7f401d049cdd4b7a8113ad29b5c5b9 (patch) | |
tree | 8624029047d7d438ee30b9b58ccb883396b4cd6b | |
parent | bcde2adde7171146cb95264ded88d4bdbcf80e04 (diff) | |
parent | f35948555731100292c11c230ce51990afc0973d (diff) | |
download | chat-088065206b7f401d049cdd4b7a8113ad29b5c5b9.tar.gz chat-088065206b7f401d049cdd4b7a8113ad29b5c5b9.tar.bz2 chat-088065206b7f401d049cdd4b7a8113ad29b5c5b9.zip |
Merge pull request #507 from mattermost/post-limit
Change GetPostsSince limit to 1000 and only add updated posts to post list order
-rw-r--r-- | store/sql_post_store.go | 8 |
1 files changed, 5 insertions, 3 deletions
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 |