summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/all_queues.yml16
-rw-r--r--app/workers/snippet_schedule_bulk_repository_shard_moves_worker.rb17
-rw-r--r--app/workers/snippet_update_repository_storage_worker.rb32
-rw-r--r--app/workers/snippets/schedule_bulk_repository_shard_moves_worker.rb15
-rw-r--r--app/workers/snippets/update_repository_storage_worker.rb25
5 files changed, 78 insertions, 27 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 70f884ed7ee..3b455b972f9 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -2204,6 +2204,22 @@
:weight: 1
:idempotent: true
:tags: []
+- :name: snippets_schedule_bulk_repository_shard_moves
+ :feature_category: :gitaly
+ :has_external_dependencies:
+ :urgency: :throttled
+ :resource_boundary: :unknown
+ :weight: 1
+ :idempotent: true
+ :tags: []
+- :name: snippets_update_repository_storage
+ :feature_category: :gitaly
+ :has_external_dependencies:
+ :urgency: :throttled
+ :resource_boundary: :unknown
+ :weight: 1
+ :idempotent: true
+ :tags: []
- :name: system_hook_push
:feature_category: :source_code_management
:has_external_dependencies:
diff --git a/app/workers/snippet_schedule_bulk_repository_shard_moves_worker.rb b/app/workers/snippet_schedule_bulk_repository_shard_moves_worker.rb
index 47f24ad3500..94a6b22538b 100644
--- a/app/workers/snippet_schedule_bulk_repository_shard_moves_worker.rb
+++ b/app/workers/snippet_schedule_bulk_repository_shard_moves_worker.rb
@@ -1,13 +1,16 @@
# frozen_string_literal: true
-class SnippetScheduleBulkRepositoryShardMovesWorker
- include ApplicationWorker
-
+# This is a compatibility class to avoid calling a non-existent
+# class from sidekiq during deployment.
+#
+# This class was moved to a namespace in https://gitlab.com/gitlab-org/gitlab/-/issues/299853.
+# we cannot remove this class entirely because there can be jobs
+# referencing it.
+#
+# We can get rid of this class in 14.0
+# https://gitlab.com/gitlab-org/gitlab/-/issues/322393
+class SnippetScheduleBulkRepositoryShardMovesWorker < Snippets::ScheduleBulkRepositoryShardMovesWorker
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
diff --git a/app/workers/snippet_update_repository_storage_worker.rb b/app/workers/snippet_update_repository_storage_worker.rb
index a28a02a0298..befae6db4f4 100644
--- a/app/workers/snippet_update_repository_storage_worker.rb
+++ b/app/workers/snippet_update_repository_storage_worker.rb
@@ -1,23 +1,15 @@
# frozen_string_literal: true
-class SnippetUpdateRepositoryStorageWorker # 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)
- SnippetRepositoryStorageMove.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
+# This is a compatibility class to avoid calling a non-existent
+# class from sidekiq during deployment.
+#
+# This class was moved to a namespace in https://gitlab.com/gitlab-org/gitlab/-/issues/299853.
+# we cannot remove this class entirely because there can be jobs
+# referencing it.
+#
+# We can get rid of this class in 14.0
+# https://gitlab.com/gitlab-org/gitlab/-/issues/322393
+class SnippetUpdateRepositoryStorageWorker < Snippets::UpdateRepositoryStorageWorker # rubocop:disable Scalability/IdempotentWorker
+ idempotent!
+ urgency :throttled
end
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