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:
Diffstat (limited to 'lib/gitlab/database/migrations/redis_helpers.rb')
-rw-r--r--lib/gitlab/database/migrations/redis_helpers.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/database/migrations/redis_helpers.rb b/lib/gitlab/database/migrations/redis_helpers.rb
new file mode 100644
index 00000000000..41a2841da7c
--- /dev/null
+++ b/lib/gitlab/database/migrations/redis_helpers.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Database
+ module Migrations
+ module RedisHelpers
+ SCAN_START_CURSOR = '0'
+
+ # Check if the migration exists before enqueueing the worker
+ def queue_redis_migration_job(job_name)
+ RedisMigrationWorker.fetch_migrator!(job_name)
+ RedisMigrationWorker.perform_async(job_name, SCAN_START_CURSOR)
+ end
+ end
+ end
+ end
+end