Class: Gitlab::GithubImport::AdvanceStageWorker
- Inherits:
-
Object
- Object
- Gitlab::GithubImport::AdvanceStageWorker
- 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.
Note: AdvanceStageWorker is not used to initiate the repository, base_data, and pull_requests stages. They are included in the list for us to easily see all stage workers and the order in which they are executed.
{ repository: Stage::ImportRepositoryWorker, base_data: Stage::ImportBaseDataWorker, pull_requests: Stage::ImportPullRequestsWorker, collaborators: Stage::ImportCollaboratorsWorker, issues_and_diff_notes: Stage::ImportIssuesAndDiffNotesWorker, issue_events: Stage::ImportIssueEventsWorker, attachments: Stage::ImportAttachmentsWorker, protected_branches: Stage::ImportProtectedBranchesWorker, 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
Constants included from WorkerAttributes
WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DATA_CONSISTENCY_PER_DB, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::LOAD_BALANCED_DATA_CONSISTENCIES, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES
Instance Method Summary collapse
Methods included from Import::AdvanceStage
Methods included from Loggable
Methods included from SidekiqVersioning::Worker
Methods included from WorkerContext
Instance Method Details
#find_import_state(id) ⇒ Object
40 41 42 |
# File 'app/workers/gitlab/github_import/advance_stage_worker.rb', line 40 def find_import_state(id) ProjectImportState.find(id) end |
#find_import_state_jid(project_id) ⇒ Object
36 37 38 |
# File 'app/workers/gitlab/github_import/advance_stage_worker.rb', line 36 def find_import_state_jid(project_id) ProjectImportState.jid_by(project_id: project_id, status: :started) end |