Class: Gitlab::BitbucketServerImport::AdvanceStageWorker

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

Overview

AdvanceStageWorker is a worker used by the BitBucket Server 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.

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

Constants included from Import::AdvanceStage

Import::AdvanceStage::AdvanceStageTimeoutError, Import::AdvanceStage::BLOCKING_WAIT_TIME, Import::AdvanceStage::INTERVAL, Import::AdvanceStage::TIMEOUT_DURATION

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from Loggable

Loggable::ANONYMOUS

Constants included from WorkerAttributes

WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Import::AdvanceStage

#perform, #wait_for_jobs

Methods included from Loggable

#build_structured_payload

Methods included from SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#find_import_state(id) ⇒ Object



32
33
34
# File 'app/workers/gitlab/bitbucket_server_import/advance_stage_worker.rb', line 32

def find_import_state(id)
  ProjectImportState.find(id)
end

#find_import_state_jid(project_id) ⇒ Object



28
29
30
# File 'app/workers/gitlab/bitbucket_server_import/advance_stage_worker.rb', line 28

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