Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-11-15 09:49:24 +0300
committerMichael Kozono <mkozono@gmail.com>2017-12-02 02:26:41 +0300
commitc25b7c0e3f6d43b5fb77e53bbd0dd4495b8e0c69 (patch)
tree2189e06a7c9ddd2fe0647f47441c824a5a664754
parentb63e8f4adfda2f907280824e6acf69bbaa56de3a (diff)
Speed up inserts
-rw-r--r--lib/gitlab/background_migration/prepare_untracked_uploads.rb6
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