From a22f6fa6e50bb31921415b01fd345d6802581390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Tue, 27 Feb 2018 13:09:33 +0000 Subject: Merge branch 'fix/sm/atomic-migration' into 'master' Fix migrate! method (Minimal fix with ExclusiveLock to prevent race conditions) Closes #4928 and #4980 See merge request gitlab-org/gitlab-ee!4624 --- app/uploaders/records_uploads.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/uploaders/records_uploads.rb') diff --git a/app/uploaders/records_uploads.rb b/app/uploaders/records_uploads.rb index 458928bc067..89c74a78835 100644 --- a/app/uploaders/records_uploads.rb +++ b/app/uploaders/records_uploads.rb @@ -24,8 +24,7 @@ module RecordsUploads uploads.where(path: upload_path).delete_all upload.destroy! if upload - self.upload = build_upload - upload.save! + self.upload = build_upload.tap(&:save!) end end -- cgit v1.2.3