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, 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 Attribute Summary collapse

Instance Method Summary collapse

Methods included from ProjectStartImport

#start

Methods included from Loggable

#build_structured_payload

Methods included from SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



16
17
18
# File 'app/workers/gitlab/jira_import/stage/start_import_worker.rb', line 16

def project
  @project
end

Instance Method Details

#perform(project_id) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'app/workers/gitlab/jira_import/stage/start_import_worker.rb', line 18

def perform(project_id)
  @project = Project.find_by_id(project_id)

  return unless start_import

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

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