diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /lib/gitlab/import | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'lib/gitlab/import')
-rw-r--r-- | lib/gitlab/import/database_helpers.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/import/metrics.rb | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/gitlab/import/database_helpers.rb b/lib/gitlab/import/database_helpers.rb index e73c3afe9bd..96490db0c07 100644 --- a/lib/gitlab/import/database_helpers.rb +++ b/lib/gitlab/import/database_helpers.rb @@ -11,8 +11,8 @@ module Gitlab # We use bulk_insert here so we can bypass any queries executed by # callbacks or validation rules, as doing this wouldn't scale when # importing very large projects. - result = Gitlab::Database.main # rubocop:disable Gitlab/BulkInsert - .bulk_insert(relation.table_name, [attributes], return_ids: true) + result = ApplicationRecord # rubocop:disable Gitlab/BulkInsert + .legacy_bulk_insert(relation.table_name, [attributes], return_ids: true) result.first end diff --git a/lib/gitlab/import/metrics.rb b/lib/gitlab/import/metrics.rb index 5f27d0ab965..7a0cf1682a6 100644 --- a/lib/gitlab/import/metrics.rb +++ b/lib/gitlab/import/metrics.rb @@ -69,11 +69,7 @@ module Gitlab end def observe_histogram - if project.github_import? - duration_histogram.observe({ project: project.full_path }, duration) - else - duration_histogram.observe({ importer: importer }, duration) - end + duration_histogram.observe({ importer: importer }, duration) end def track_finish_metric |