diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 18:09:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 18:09:16 +0000 |
commit | 80e9fdc9682cfbcfb9202a2733605a6a6bd23f05 (patch) | |
tree | 168375ea13d1a1f01d4cbcf6f0513fc9883e9477 /app/models | |
parent | 5372e109c0660e4670aa987568a51082beca1b3c (diff) | |
download | gitlab-ce-80e9fdc9682cfbcfb9202a2733605a6a6bd23f05.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project_import_state.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb index 52fd23aefd5..f58b8dc624d 100644 --- a/app/models/project_import_state.rb +++ b/app/models/project_import_state.rb @@ -10,6 +10,8 @@ class ProjectImportState < ApplicationRecord validates :project, presence: true + alias_attribute :correlation_id, :correlation_id_value + state_machine :status, initial: :none do event :schedule do transition [:none, :finished, :failed] => :scheduled @@ -39,7 +41,11 @@ class ProjectImportState < ApplicationRecord after_transition [:none, :finished, :failed] => :scheduled do |state, _| state.run_after_commit do job_id = project.add_import_job - update(jid: job_id) if job_id + + if job_id + correlation_id = Labkit::Correlation::CorrelationId.current_or_new_id + update(jid: job_id, correlation_id_value: correlation_id) + end end end |