From 487bb56a9b8f5c7a9efaabfc631f2f6c689ef74b Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 7 Feb 2017 12:36:37 -0800 Subject: Add caching for file infos (#5330) --- app/post.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/post.go') diff --git a/app/post.go b/app/post.go index 82fc733b4..5fddd3e78 100644 --- a/app/post.go +++ b/app/post.go @@ -457,7 +457,7 @@ func SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bo func GetFileInfosForPost(postId string) ([]*model.FileInfo, *model.AppError) { pchan := Srv.Store.Post().Get(postId) - fchan := Srv.Store.FileInfo().GetForPost(postId) + fchan := Srv.Store.FileInfo().GetForPost(postId, true) var infos []*model.FileInfo if result := <-fchan; result.Err != nil { @@ -476,6 +476,7 @@ func GetFileInfosForPost(postId string) ([]*model.FileInfo, *model.AppError) { } if len(post.Filenames) > 0 { + Srv.Store.FileInfo().InvalidateFileInfosForPostCache(postId) // The post has Filenames that need to be replaced with FileInfos infos = MigrateFilenamesToFileInfos(post) } -- cgit v1.2.3-1-g7c22