diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 03:06:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 03:06:08 +0300 |
commit | 157f9a451a428f66666ba85d8b880df78aff6cc4 (patch) | |
tree | 7c38cacafb9720d144a6add0a170a07a7cc376f6 /app/models/project_import_state.rb | |
parent | 7f15e74dae019ac96c65ec769eae2d67aae65a8c (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.rb | 16 |
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, |