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>2019-11-22 03:06:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-22 03:06:08 +0300
commit157f9a451a428f66666ba85d8b880df78aff6cc4 (patch)
tree7c38cacafb9720d144a6add0a170a07a7cc376f6 /app/models/project_import_state.rb
parent7f15e74dae019ac96c65ec769eae2d67aae65a8c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_import_state.rb')
-rw-r--r--app/models/project_import_state.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb
index bff00816e15..b79e3554926 100644
--- a/app/models/project_import_state.rb
+++ b/app/models/project_import_state.rb
@@ -42,6 +42,14 @@ class ProjectImportState < ApplicationRecord
end
end
+ after_transition any => :finished do |state, _|
+ if state.jid.present?
+ Gitlab::SidekiqStatus.unset(state.jid)
+
+ state.update_column(:jid, nil)
+ end
+ end
+
after_transition started: :finished do |state, _|
project = state.project
@@ -81,14 +89,6 @@ class ProjectImportState < ApplicationRecord
status == 'started' && project.import?
end
- def remove_jid
- return unless jid
-
- Gitlab::SidekiqStatus.unset(jid)
-
- update_column(:jid, nil)
- end
-
# Refreshes the expiration time of the associated import job ID.
#
# This method can be used by asynchronous importers to refresh the status,