Class: Gitlab::GithubImport::ParallelImporter

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ ParallelImporter

Returns a new instance of ParallelImporter.


27
28
29
# File 'lib/gitlab/github_import/parallel_importer.rb', line 27

def initialize(project)
  @project = project
end

Instance Attribute Details

#projectObject (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

Returns:

  • (Boolean)

10
11
12
# File 'lib/gitlab/github_import/parallel_importer.rb', line 10

def self.async?
  true
end

.imports_repository?Boolean

Returns:

  • (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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

22
23
24
# File 'lib/gitlab/github_import/parallel_importer.rb', line 22

def self.requires_ci_cd_setup?
  raise NotImplementedError
end

Instance Method Details

#executeObject


31
32
33
34
35
36
37
38
# File 'lib/gitlab/github_import/parallel_importer.rb', line 31

def execute
  Gitlab::Import::SetAsyncJid.set_jid(project.import_state)

  Stage::ImportRepositoryWorker
    .perform_async(project.id)

  true
end