PLT-7826: Don't fetch posts from store if ES returns none. (#7596)
Этот коммит содержится в:
коммит произвёл
Chris
родитель
2a76eeeeee
Коммит
0da0cf1a21
14
app/post.go
14
app/post.go
@@ -602,12 +602,14 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
|
||||
|
||||
// Get the posts
|
||||
postList := model.NewPostList()
|
||||
if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil {
|
||||
return nil, presult.Err
|
||||
} else {
|
||||
for _, p := range presult.Data.([]*model.Post) {
|
||||
postList.AddPost(p)
|
||||
postList.AddOrder(p.Id)
|
||||
if len(postIds) > 0 {
|
||||
if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil {
|
||||
return nil, presult.Err
|
||||
} else {
|
||||
for _, p := range presult.Data.([]*model.Post) {
|
||||
postList.AddPost(p)
|
||||
postList.AddOrder(p.Id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user