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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
commit80e9fdc9682cfbcfb9202a2733605a6a6bd23f05 (patch)
tree168375ea13d1a1f01d4cbcf6f0513fc9883e9477 /app/models
parent5372e109c0660e4670aa987568a51082beca1b3c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_import_state.rb8
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