Add caching for file infos (#5330)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
eb767d2c1c
Коммит
487bb56a9b
@@ -26,7 +26,7 @@ import (
|
||||
|
||||
func SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User) ([]string, *model.AppError) {
|
||||
pchan := Srv.Store.User().GetAllProfilesInChannel(channel.Id, true)
|
||||
fchan := Srv.Store.FileInfo().GetForPost(post.Id)
|
||||
fchan := Srv.Store.FileInfo().GetForPost(post.Id, true)
|
||||
|
||||
var profileMap map[string]*model.User
|
||||
if result := <-pchan; result.Err != nil {
|
||||
@@ -414,7 +414,7 @@ func GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFun
|
||||
|
||||
// extract the filenames from their paths and determine what type of files are attached
|
||||
var infos []*model.FileInfo
|
||||
if result := <-Srv.Store.FileInfo().GetForPost(post.Id); result.Err != nil {
|
||||
if result := <-Srv.Store.FileInfo().GetForPost(post.Id, true); result.Err != nil {
|
||||
l4g.Warn(utils.T("api.post.get_message_for_notification.get_files.error"), post.Id, result.Err)
|
||||
} else {
|
||||
infos = result.Data.([]*model.FileInfo)
|
||||
|
||||
Ссылка в новой задаче
Block a user