diff options
Diffstat (limited to 'lib/gitlab/bitbucket_server_import/parallel_importer.rb')
-rw-r--r-- | lib/gitlab/bitbucket_server_import/parallel_importer.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/gitlab/bitbucket_server_import/parallel_importer.rb b/lib/gitlab/bitbucket_server_import/parallel_importer.rb new file mode 100644 index 00000000000..355944ed350 --- /dev/null +++ b/lib/gitlab/bitbucket_server_import/parallel_importer.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Gitlab + module BitbucketServerImport + class ParallelImporter + def self.async? + true + end + + def self.imports_repository? + true + end + + def self.track_start_import(project) + Gitlab::Import::Metrics.new(:bitbucket_server_importer, project).track_start_import + end + + def initialize(project) + @project = project + end + + def execute + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) + + Stage::ImportRepositoryWorker + .with_status + .perform_async(project.id) + + true + end + + private + + attr_reader :project + end + end +end |