Class: Gitlab::GithubImport::AdvanceStageWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, Import::AdvanceStage
Defined in:
app/workers/gitlab/github_import/advance_stage_worker.rb

Overview

AdvanceStageWorker is a worker used by the GitHub importer to wait for a number of jobs to complete, without blocking a thread. Once all jobs have been completed this worker will advance the import process to the next stage.

Constant Summary collapse

STAGES =

The known importer stages and their corresponding Sidekiq workers.

{
  issues_and_diff_notes: Stage::ImportIssuesAndDiffNotesWorker,
  notes: Stage::ImportNotesWorker,
  lfs_objects: Stage::ImportLfsObjectsWorker,
  finish: Stage::FinishImportWorker
}.freeze

Constants included from Import::AdvanceStage

Import::AdvanceStage::BLOCKING_WAIT_TIME, Import::AdvanceStage::INTERVAL

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Import::AdvanceStage

#perform, #wait_for_jobs

Methods included from SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#find_import_state(project_id) ⇒ Object


25
26
27
# File 'app/workers/gitlab/github_import/advance_stage_worker.rb', line 25

def find_import_state(project_id)
  ProjectImportState.jid_by(project_id: project_id, status: :started)
end