diff options
Diffstat (limited to 'app/workers/gitlab/jira_import/advance_stage_worker.rb')
-rw-r--r-- | app/workers/gitlab/jira_import/advance_stage_worker.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/workers/gitlab/jira_import/advance_stage_worker.rb b/app/workers/gitlab/jira_import/advance_stage_worker.rb new file mode 100644 index 00000000000..1b6fc54151e --- /dev/null +++ b/app/workers/gitlab/jira_import/advance_stage_worker.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Gitlab + module JiraImport + class AdvanceStageWorker # rubocop:disable Scalability/IdempotentWorker + include ApplicationWorker + include QueueOptions + include ::Gitlab::Import::AdvanceStage + + # The known importer stages and their corresponding Sidekiq workers. + STAGES = { + labels: Gitlab::JiraImport::Stage::ImportLabelsWorker, + issues: Gitlab::JiraImport::Stage::ImportIssuesWorker, + attachments: Gitlab::JiraImport::Stage::ImportAttachmentsWorker, + notes: Gitlab::JiraImport::Stage::ImportNotesWorker, + finish: Gitlab::JiraImport::Stage::FinishImportWorker + }.freeze + + private + + def next_stage_worker(next_stage) + STAGES.fetch(next_stage.to_sym) + end + end + end +end |