MM-15846 migrating get posts to sync by default (#10994)

* migrating get posts to sync by default

* flow control and style changes

* style changes, error checking

* pulling master down

* counting missed cache, not hit

* fixing bad conflict resolution

* forcing rebuild
Этот коммит содержится в:
Evan do Carmo
2019-05-30 10:44:33 -04:00
коммит произвёл Gabe Jackson
родитель 427effcd5c
Коммит cee1e36859
7 изменённых файлов: 73 добавлений и 70 удалений

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

@@ -452,7 +452,9 @@ func TestAddChannelMemberNoUserRequestor(t *testing.T) {
}
assert.Equal(t, groupUserIds, channelMemberHistoryUserIds)
postList := store.Must(th.App.Srv.Store.Post().GetPosts(channel.Id, 0, 1, false)).(*model.PostList)
postList, err := th.App.Srv.Store.Post().GetPosts(channel.Id, 0, 1, false)
require.Nil(t,err)
if assert.Len(t, postList.Order, 1) {
post := postList.Posts[postList.Order[0]]

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

@@ -239,7 +239,7 @@ func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo {
// Find the team that was used to make this post since its part of the file path that isn't saved in the Filename
var teamId string
if channel.TeamId == "" {
// This post was made in a cross-team DM channel so we need to find where its files were saved
// This post was made in a cross-team DM channel, so we need to find where its files were saved
teamId = a.FindTeamIdForFilename(post, filenames[0])
} else {
teamId = channel.TeamId

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

@@ -599,19 +599,11 @@ func (a *App) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *mo
}
func (a *App) GetPostsPage(channelId string, page int, perPage int) (*model.PostList, *model.AppError) {
result := <-a.Srv.Store.Post().GetPosts(channelId, page*perPage, perPage, true)
if result.Err != nil {
return nil, result.Err
}
return result.Data.(*model.PostList), nil
return a.Srv.Store.Post().GetPosts(channelId, page*perPage, perPage, true)
}
func (a *App) GetPosts(channelId string, offset int, limit int) (*model.PostList, *model.AppError) {
result := <-a.Srv.Store.Post().GetPosts(channelId, offset, limit, true)
if result.Err != nil {
return nil, result.Err
}
return result.Data.(*model.PostList), nil
return a.Srv.Store.Post().GetPosts(channelId, offset, limit, true)
}
func (a *App) GetPostsEtag(channelId string) string {