diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-12-22 16:54:33 +0300 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2019-01-25 22:26:35 +0300 |
commit | c2c34eba62f26bed8cad8b07934e14b4519eef7c (patch) | |
tree | b5ab373fc66274e4a902ff828f1ba460300d30fa /app | |
parent | 07a196be3dca5125454262bb96967d5895081c56 (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.rb | 10 |
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 |