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
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2019-01-17 04:53:50 +0300
committerGabriel Mazetto <brodock@gmail.com>2019-01-25 22:26:35 +0300
commit7bc16889df458865ffbbb7bef8087c04a5768a1d (patch)
tree23842ae1d6de742eb8064f196e39dd90c179bd7c /app/workers/hashed_storage
parentb88f27c8d1cb44201490bf51db143f4267735775 (diff)
Refactor Storage Migration
Specs were reviewed and improved to better cover the current behavior. There was some standardization done as well to facilitate the implementation of the rollback functionality. StorageMigratorWorker was extracted to HashedStorage namespace were RollbackerWorker will live one as well.
Diffstat (limited to 'app/workers/hashed_storage')
-rw-r--r--app/workers/hashed_storage/migrator_worker.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/hashed_storage/migrator_worker.rb b/app/workers/hashed_storage/migrator_worker.rb
new file mode 100644
index 00000000000..49e347d4060
--- /dev/null
+++ b/app/workers/hashed_storage/migrator_worker.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module HashedStorage
+ class MigratorWorker
+ 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_migrate(start: start, finish: finish)
+ end
+ end
+end