Welcome to mirror list, hosted at ThFree Co, Russian Federation.

advance_stage_worker.rb « jira_import « gitlab « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b6fc54151ea6fcbeef9246ef3879853472592b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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