Merge pull request #507 from mattermost/post-limit

Change GetPostsSince limit to 1000 and only add updated posts to post list order
Этот коммит содержится в:
Corey Hulen
2015-08-27 15:59:00 -07:00
родитель bcde2adde7 f359485557
Коммит 088065206b

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

@@ -291,7 +291,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE WHERE
(UpdateAt > :Time (UpdateAt > :Time
AND ChannelId = :ChannelId) AND ChannelId = :ChannelId)
LIMIT 100) LIMIT 1000)
UNION UNION
(SELECT (SELECT
* *
@@ -307,7 +307,7 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
WHERE WHERE
UpdateAt > :Time UpdateAt > :Time
AND ChannelId = :ChannelId AND ChannelId = :ChannelId
LIMIT 100) temp_tab)) LIMIT 1000) temp_tab))
ORDER BY CreateAt DESC`, ORDER BY CreateAt DESC`,
map[string]interface{}{"ChannelId": channelId, "Time": time}) map[string]interface{}{"ChannelId": channelId, "Time": time})
@@ -319,7 +319,9 @@ func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
for _, p := range posts { for _, p := range posts {
list.AddPost(p) list.AddPost(p)
list.AddOrder(p.Id) if p.UpdateAt > time {
list.AddOrder(p.Id)
}
} }
result.Data = list result.Data = list