PLT-3105 Fixed bugs with FileInfos migration, including duplicate FileInfos being saved (#4134)

* Added a limit to GetByPath for the rare cases when two old files had the same path

* Fixed files still being displayed for deleted posts

* Added a lock to prevent migrateFilenamesToFileInfos from migrating multiple posts at once
Этот коммит содержится в:
Harrison Healey
2016-10-06 16:44:41 -04:00
коммит произвёл enahum
родитель c9793a566a
Коммит 7fb818d4ce
5 изменённых файлов: 57 добавлений и 11 удалений

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

@@ -101,7 +101,8 @@ func (fs SqlFileInfoStore) GetByPath(path string) StoreChannel {
FileInfo
WHERE
Path = :Path
AND DeleteAt = 0`, map[string]interface{}{"Path": path}); err != nil {
AND DeleteAt = 0
LIMIT 1`, map[string]interface{}{"Path": path}); err != nil {
result.Err = model.NewLocAppError("SqlFileInfoStore.GetByPath", "store.sql_file_info.get_by_path.app_error", nil, "path="+path+", "+err.Error())
} else {
result.Data = info