diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-11-15 09:49:24 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-12-02 02:26:41 +0300 |
commit | c25b7c0e3f6d43b5fb77e53bbd0dd4495b8e0c69 (patch) | |
tree | 2189e06a7c9ddd2fe0647f47441c824a5a664754 | |
parent | b63e8f4adfda2f907280824e6acf69bbaa56de3a (diff) |
Speed up inserts
-rw-r--r-- | lib/gitlab/background_migration/prepare_untracked_uploads.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration/prepare_untracked_uploads.rb b/lib/gitlab/background_migration/prepare_untracked_uploads.rb index e9d162661d1..983e63143e0 100644 --- a/lib/gitlab/background_migration/prepare_untracked_uploads.rb +++ b/lib/gitlab/background_migration/prepare_untracked_uploads.rb @@ -80,8 +80,10 @@ module Gitlab end def insert_file_paths(file_paths) - file_paths.each do |file_path| - insert_file_path(file_path) + ActiveRecord::Base.transaction do + file_paths.each do |file_path| + insert_file_path(file_path) + end end end |