PLT-7826: Don't fetch posts from store if ES returns none. (#7596)

Этот коммит содержится в:
George Goldberg
2017-10-09 18:14:27 +01:00
коммит произвёл Chris
родитель 2a76eeeeee
Коммит 0da0cf1a21

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

@@ -602,6 +602,7 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
// Get the posts // Get the posts
postList := model.NewPostList() postList := model.NewPostList()
if len(postIds) > 0 {
if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil { if presult := <-a.Srv.Store.Post().GetPostsByIds(postIds); presult.Err != nil {
return nil, presult.Err return nil, presult.Err
} else { } else {
@@ -610,6 +611,7 @@ func (a *App) SearchPostsInTeam(terms string, userId string, teamId string, isOr
postList.AddOrder(p.Id) postList.AddOrder(p.Id)
} }
} }
}
return postList, nil return postList, nil
} else { } else {