summaryrefslogtreecommitdiffstats
path: root/app/post.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-07 12:36:37 -0800
committerGitHub <noreply@github.com>2017-02-07 12:36:37 -0800
commit487bb56a9b8f5c7a9efaabfc631f2f6c689ef74b (patch)
treea92bcbe004045581752c33dfd126c211300cda25 /app/post.go
parenteb767d2c1cb65724f25479144d68a9d102d32dfa (diff)
downloadchat-487bb56a9b8f5c7a9efaabfc631f2f6c689ef74b.tar.gz
chat-487bb56a9b8f5c7a9efaabfc631f2f6c689ef74b.tar.bz2
chat-487bb56a9b8f5c7a9efaabfc631f2f6c689ef74b.zip
Add caching for file infos (#5330)
Diffstat (limited to 'app/post.go')
-rw-r--r--app/post.go3
1 files changed, 2 insertions, 1 deletions
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)
}