diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 00:08:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 00:08:01 +0300 |
commit | 561e1b470f0a99fe6304c8f197348c47a637d594 (patch) | |
tree | 6b361b6b0b412b70450aca167079c50a13bd88d8 /app/workers | |
parent | 7b52c7cb634ef7047d30b0337fe477bcdcedf41d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 7 | ||||
-rw-r--r-- | app/workers/project_update_repository_storage_worker.rb | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 259b2efc49f..61e9f50c2dd 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -1151,6 +1151,13 @@ :resource_boundary: :unknown :weight: 1 :idempotent: +- :name: project_update_repository_storage + :feature_category: :source_code_management + :has_external_dependencies: + :urgency: :default + :resource_boundary: :unknown + :weight: 1 + :idempotent: - :name: propagate_service_template :feature_category: :source_code_management :has_external_dependencies: diff --git a/app/workers/project_update_repository_storage_worker.rb b/app/workers/project_update_repository_storage_worker.rb new file mode 100644 index 00000000000..2d88b532dbf --- /dev/null +++ b/app/workers/project_update_repository_storage_worker.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ProjectUpdateRepositoryStorageWorker # rubocop:disable Scalability/IdempotentWorker + include ApplicationWorker + + feature_category :source_code_management + + def perform(project_id, new_repository_storage_key) + project = Project.find(project_id) + + ::Projects::UpdateRepositoryStorageService.new(project).execute(new_repository_storage_key) + rescue ::Projects::UpdateRepositoryStorageService::RepositoryAlreadyMoved + Rails.logger.info "#{self.class}: repository already moved: #{project}" # rubocop:disable Gitlab/RailsLogger + end +end |