Class: Gitlab::GithubImport::ParallelImporter
- Inherits:
-
Object
- Object
- Gitlab::GithubImport::ParallelImporter
- Defined in:
- lib/gitlab/github_import/parallel_importer.rb
Overview
The ParallelImporter schedules the importing of a GitHub project using Sidekiq.
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Class Method Summary collapse
- .async? ⇒ Boolean
- .imports_repository? ⇒ Boolean
- .requires_ci_cd_setup? ⇒ Boolean
- .track_start_import(project) ⇒ Object
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project) ⇒ ParallelImporter
constructor
A new instance of ParallelImporter.
Constructor Details
#initialize(project) ⇒ ParallelImporter
Returns a new instance of ParallelImporter.
31 32 33 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 31 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
8 9 10 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 8 def project @project end |
Class Method Details
.async? ⇒ Boolean
10 11 12 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 10 def self.async? true end |
.imports_repository? ⇒ Boolean
14 15 16 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 14 def self.imports_repository? true end |
.requires_ci_cd_setup? ⇒ Boolean
26 27 28 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 26 def self.requires_ci_cd_setup? raise NotImplementedError end |
.track_start_import(project) ⇒ Object
18 19 20 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 18 def self.track_start_import(project) Gitlab::Import::Metrics.new(:github_importer, project).track_start_import end |
Instance Method Details
#execute ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gitlab/github_import/parallel_importer.rb', line 35 def execute Gitlab::Import::SetAsyncJid.set_jid(project.import_state) # We need to track this job's status for use by Gitlab::GithubImport::RefreshImportJidWorker. Stage::ImportRepositoryWorker .with_status .perform_async(project.id) true end |