diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-10-06 16:44:41 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-10-06 17:44:41 -0300 |
commit | 7fb818d4cef09dd74f9fcfd99381a7c0e7064a56 (patch) | |
tree | 0f79dd96a91420f4a4fa377ecc900deeb084416a /store | |
parent | c9793a566a4f425997448a742b16ed8754c17bae (diff) | |
download | chat-7fb818d4cef09dd74f9fcfd99381a7c0e7064a56.tar.gz chat-7fb818d4cef09dd74f9fcfd99381a7c0e7064a56.tar.bz2 chat-7fb818d4cef09dd74f9fcfd99381a7c0e7064a56.zip |
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
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_file_info_store.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/store/sql_file_info_store.go b/store/sql_file_info_store.go index 5c3f6b1a4..78c36c08a 100644 --- a/store/sql_file_info_store.go +++ b/store/sql_file_info_store.go @@ -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 |