summaryrefslogtreecommitdiff
path: root/app/uploaders/records_uploads.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-27 13:09:33 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-28 21:28:26 +0100
commita22f6fa6e50bb31921415b01fd345d6802581390 (patch)
tree4e617f85dd0500b1c0bb004f9a4ed3e2000df818 /app/uploaders/records_uploads.rb
parentb4dc556c2f40f2e8e4d71c5dd8d1747974f8147f (diff)
downloadgitlab-ce-a22f6fa6e50bb31921415b01fd345d6802581390.tar.gz
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
Diffstat (limited to 'app/uploaders/records_uploads.rb')
-rw-r--r--app/uploaders/records_uploads.rb3
1 files changed, 1 insertions, 2 deletions
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