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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 21:09:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 21:09:10 +0300
commit33795139ea8e72756bee3675b4e16387425e6ab1 (patch)
tree3ca568fca61482e57810ee30ad5ce4b964a82c4e /doc/development/background_migrations.md
parentc7e385e282bcb8505589bce526e692b7bb819ffa (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/background_migrations.md')
-rw-r--r--doc/development/background_migrations.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index dfe2312c2fa..9dbfde98766 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -72,20 +72,21 @@ migration classes must be defined in the namespace
## Scheduling
-Scheduling a background migration should be done in a post-deployment migration.
+Scheduling a background migration should be done in a post-deployment
+migration that includes `Gitlab::Database::MigrationHelpers`
To do so, simply use the following code while
replacing the class name and arguments with whatever values are necessary for
your migration:
```ruby
-BackgroundMigrationWorker.perform_async('BackgroundMigrationClassName', [arg1, arg2, ...])
+migrate_async('BackgroundMigrationClassName', [arg1, arg2, ...])
```
Usually it's better to enqueue jobs in bulk, for this you can use
-`BackgroundMigrationWorker.bulk_perform_async`:
+`bulk_migrate_async`:
```ruby
-BackgroundMigrationWorker.bulk_perform_async(
+bulk_migrate_async(
[['BackgroundMigrationClassName', [1]],
['BackgroundMigrationClassName', [2]]]
)
@@ -105,7 +106,7 @@ If you would like to schedule jobs in bulk with a delay, you can use
jobs = [['BackgroundMigrationClassName', [1]],
['BackgroundMigrationClassName', [2]]]
-BackgroundMigrationWorker.bulk_perform_in(5.minutes, jobs)
+bulk_migrate_in(5.minutes, jobs)
```
### Rescheduling background migrations