Module: Gitlab::GithubImport::StageMethods
- Extended by:
- ActiveSupport::Concern
- Includes:
- Import::ResumableImportJob
- Included in:
- Gitlab::GithubImport::Stage::FinishImportWorker, Gitlab::GithubImport::Stage::ImportAttachmentsWorker, Gitlab::GithubImport::Stage::ImportBaseDataWorker, Gitlab::GithubImport::Stage::ImportCollaboratorsWorker, Gitlab::GithubImport::Stage::ImportIssueEventsWorker, Gitlab::GithubImport::Stage::ImportIssuesAndDiffNotesWorker, Gitlab::GithubImport::Stage::ImportLfsObjectsWorker, Gitlab::GithubImport::Stage::ImportNotesWorker, Gitlab::GithubImport::Stage::ImportProtectedBranchesWorker, Gitlab::GithubImport::Stage::ImportPullRequestsMergedByWorker, Gitlab::GithubImport::Stage::ImportPullRequestsReviewRequestsWorker, Gitlab::GithubImport::Stage::ImportPullRequestsReviewsWorker, Gitlab::GithubImport::Stage::ImportPullRequestsWorker, Gitlab::GithubImport::Stage::ImportRepositoryWorker
- Defined in:
- app/workers/concerns/gitlab/github_import/stage_methods.rb
Constant Summary
Constants included from Import::ResumableImportJob
Import::ResumableImportJob::MAX_RETRIES_AFTER_INTERRUPTION
Instance Method Summary collapse
-
#perform(project_id) ⇒ Object
project_id - The ID of the GitLab project to import the data into.
Instance Method Details
#perform(project_id) ⇒ Object
project_id - The ID of the GitLab project to import the data into.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/workers/concerns/gitlab/github_import/stage_methods.rb', line 28 def perform(project_id) info(project_id, message: 'starting stage') return unless (project = Project.find_by_id(project_id)) if project.import_state&.completed? info( project_id, message: 'Project import is no longer running. Stopping worker.', import_status: project.import_state.status ) return end Import::RefreshImportJidWorker.perform_in_the_future(project.id, jid) client = GithubImport.new_client_for(project) try_import(client, project) rescue StandardError => e Gitlab::Import::ImportFailureService.track( project_id: project_id, exception: e, error_source: self.class.name, fail_import: false, metrics: true ) raise(e) end |