summaryrefslogtreecommitdiff
path: root/app/workers/hashed_storage
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/hashed_storage')
-rw-r--r--app/workers/hashed_storage/project_migrate_worker.rb4
-rw-r--r--app/workers/hashed_storage/project_rollback_worker.rb4
-rw-r--r--app/workers/hashed_storage/rollbacker_worker.rb16
3 files changed, 20 insertions, 4 deletions
diff --git a/app/workers/hashed_storage/project_migrate_worker.rb b/app/workers/hashed_storage/project_migrate_worker.rb
index 05bf72f519a..d516929129f 100644
--- a/app/workers/hashed_storage/project_migrate_worker.rb
+++ b/app/workers/hashed_storage/project_migrate_worker.rb
@@ -14,8 +14,8 @@ module HashedStorage
uuid = lease_for(project_id).try_obtain
if uuid
- project = Project.find_by(id: project_id)
- return if project.nil? || project.pending_delete?
+ project = Project.without_deleted.find_by(id: project_id)
+ return unless project
old_disk_path ||= project.disk_path
diff --git a/app/workers/hashed_storage/project_rollback_worker.rb b/app/workers/hashed_storage/project_rollback_worker.rb
index ace9fea98a6..c6ac76a1674 100644
--- a/app/workers/hashed_storage/project_rollback_worker.rb
+++ b/app/workers/hashed_storage/project_rollback_worker.rb
@@ -13,8 +13,8 @@ module HashedStorage
uuid = lease_for(project_id).try_obtain
if uuid
- project = Project.find_by(id: project_id)
- return if project.nil? || project.pending_delete?
+ project = Project.without_deleted.find_by(id: project_id)
+ return unless project
old_disk_path ||= project.disk_path
diff --git a/app/workers/hashed_storage/rollbacker_worker.rb b/app/workers/hashed_storage/rollbacker_worker.rb
new file mode 100644
index 00000000000..a4da8443787
--- /dev/null
+++ b/app/workers/hashed_storage/rollbacker_worker.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module HashedStorage
+ class RollbackerWorker
+ include ApplicationWorker
+
+ queue_namespace :hashed_storage
+
+ # @param [Integer] start initial ID of the batch
+ # @param [Integer] finish last ID of the batch
+ def perform(start, finish)
+ migrator = Gitlab::HashedStorage::Migrator.new
+ migrator.bulk_rollback(start: start, finish: finish)
+ end
+ end
+end