diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 21:18:33 +0300 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/workers/snippets | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/workers/snippets')
-rw-r--r-- | app/workers/snippets/schedule_bulk_repository_shard_moves_worker.rb | 15 | ||||
-rw-r--r-- | app/workers/snippets/update_repository_storage_worker.rb | 25 |
2 files changed, 40 insertions, 0 deletions
diff --git a/app/workers/snippets/schedule_bulk_repository_shard_moves_worker.rb b/app/workers/snippets/schedule_bulk_repository_shard_moves_worker.rb new file mode 100644 index 00000000000..ec3d9dbdf97 --- /dev/null +++ b/app/workers/snippets/schedule_bulk_repository_shard_moves_worker.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Snippets + class ScheduleBulkRepositoryShardMovesWorker + include ApplicationWorker + + idempotent! + feature_category :gitaly + urgency :throttled + + def perform(source_storage_name, destination_storage_name = nil) + Snippets::ScheduleBulkRepositoryShardMovesService.new.execute(source_storage_name, destination_storage_name) + end + end +end diff --git a/app/workers/snippets/update_repository_storage_worker.rb b/app/workers/snippets/update_repository_storage_worker.rb new file mode 100644 index 00000000000..83b655e9986 --- /dev/null +++ b/app/workers/snippets/update_repository_storage_worker.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Snippets + class UpdateRepositoryStorageWorker # rubocop:disable Scalability/IdempotentWorker + extend ::Gitlab::Utils::Override + include ::UpdateRepositoryStorageWorker + + private + + override :find_repository_storage_move + def find_repository_storage_move(repository_storage_move_id) + Snippets::RepositoryStorageMove.find(repository_storage_move_id) + end + + override :find_container + def find_container(container_id) + Snippet.find(container_id) + end + + override :update_repository_storage + def update_repository_storage(repository_storage_move) + ::Snippets::UpdateRepositoryStorageService.new(repository_storage_move).execute + end + end +end |