Class: Gitlab::JiraImport::Stage::StartImportWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, QueueOptions, ProjectImportOptions, ProjectStartImport
Defined in:
app/workers/gitlab/jira_import/stage/start_import_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ProjectImportOptions

ProjectImportOptions::IMPORT_RETRY_COUNT

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ProjectStartImport

#start

Methods included from SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project


12
13
14
# File 'app/workers/gitlab/jira_import/stage/start_import_worker.rb', line 12

def project
  @project
end

Instance Method Details

#perform(project_id) ⇒ Object


14
15
16
17
18
19
20
21
22
# File 'app/workers/gitlab/jira_import/stage/start_import_worker.rb', line 14

def perform(project_id)
  @project = Project.find_by(id: project_id) # rubocop: disable CodeReuse/ActiveRecord

  return unless start_import

  Gitlab::Import::SetAsyncJid.set_jid(project.latest_jira_import)

  Gitlab::JiraImport::Stage::ImportLabelsWorker.perform_async(project.id)
end