Commit c25b7c0e authored by Michael Kozono's avatar Michael Kozono

Speed up inserts

parent b63e8f4a
...@@ -80,10 +80,12 @@ module Gitlab ...@@ -80,10 +80,12 @@ module Gitlab
end end
def insert_file_paths(file_paths) def insert_file_paths(file_paths)
ActiveRecord::Base.transaction do
file_paths.each do |file_path| file_paths.each do |file_path|
insert_file_path(file_path) insert_file_path(file_path)
end end
end end
end
def insert_file_path(file_path) def insert_file_path(file_path)
table_columns_and_values = 'untracked_files_for_uploads (path, created_at, updated_at) VALUES (?, ?, ?)' table_columns_and_values = 'untracked_files_for_uploads (path, created_at, updated_at) VALUES (?, ?, ?)'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment