Fixing problem with read-replica on indexing files (#17460)

Этот коммит содержится в:
Jesús Espino
2021-04-20 12:30:43 +02:00
коммит произвёл GitHub
родитель 4295a1f556
Коммит 368b642105
7 изменённых файлов: 95 добавлений и 4 удалений

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

@@ -105,7 +105,7 @@ func (s SearchFileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, error)
func (s SearchFileInfoStore) SetContent(fileID, content string) error {
err := s.FileInfoStore.SetContent(fileID, content)
if err == nil {
nfile, err2 := s.FileInfoStore.Get(fileID)
nfile, err2 := s.FileInfoStore.GetFromMaster(fileID)
if err2 == nil {
nfile.Content = content
s.indexFile(nfile)
@@ -117,7 +117,7 @@ func (s SearchFileInfoStore) SetContent(fileID, content string) error {
func (s SearchFileInfoStore) AttachToPost(fileId, postId, creatorId string) error {
err := s.FileInfoStore.AttachToPost(fileId, postId, creatorId)
if err == nil {
nFileInfo, err2 := s.FileInfoStore.Get(fileId)
nFileInfo, err2 := s.FileInfoStore.GetFromMaster(fileId)
if err2 == nil {
s.indexFile(nFileInfo)
}