Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2018-12-22 16:54:33 +0300
committerGabriel Mazetto <brodock@gmail.com>2019-01-25 22:26:35 +0300
commitc2c34eba62f26bed8cad8b07934e14b4519eef7c (patch)
treeb5ab373fc66274e4a902ff828f1ba460300d30fa /app
parent07a196be3dca5125454262bb96967d5895081c56 (diff)
Prepare rake task for storage rollback
We are keeping compatibility with existing scheduled jobs.
Diffstat (limited to 'app')
-rw-r--r--app/workers/storage_migrator_worker.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/workers/storage_migrator_worker.rb b/app/workers/storage_migrator_worker.rb
index fa76fbac55c..714c4eed5b2 100644
--- a/app/workers/storage_migrator_worker.rb
+++ b/app/workers/storage_migrator_worker.rb
@@ -3,8 +3,14 @@
class StorageMigratorWorker
include ApplicationWorker
- def perform(start, finish)
+ # @param [Integer] start initial ID of the batch
+ # @param [Integer] finish last ID of the batch
+ # @param [String] operation the operation to be performed: ['migrate', 'rollback']
+ def perform(start, finish, operation = :migrate)
+ # when scheduling a job symbols are converted to string, we need to convert back
+ operation = operation.to_sym if operation
+
migrator = Gitlab::HashedStorage::Migrator.new
- migrator.bulk_migrate(start, finish)
+ migrator.bulk_migrate(start: start, finish: finish, operation: operation)
end
end