diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-07-08 11:04:25 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-07-08 11:04:25 +0000 |
commit | 420f6b5474e49e17226415250846e48fe514fe0d (patch) | |
tree | 95b707efe16f90b6eb4a87c9bee349cd1cd3b256 /doc | |
parent | 43b9141c365930326d50c8c8566d67722172d2ec (diff) | |
parent | e36daa0fd95c93967708447b3b8f615c2a81e3b5 (diff) | |
download | gitlab-ce-420f6b5474e49e17226415250846e48fe514fe0d.tar.gz |
Merge branch 'fix/gb/stage-id-reference-background-migration' into 'master'
Add build stage_id reference background migration
Closes #34151
See merge request !12513
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/background_migrations.md | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md index 0239e6b3163..72a34aa7de9 100644 --- a/doc/development/background_migrations.md +++ b/doc/development/background_migrations.md @@ -50,14 +50,13 @@ your migration: BackgroundMigrationWorker.perform_async('BackgroundMigrationClassName', [arg1, arg2, ...]) ``` -Usually it's better to schedule jobs in bulk, for this you can use +Usually it's better to enqueue jobs in bulk, for this you can use `BackgroundMigrationWorker.perform_bulk`: ```ruby BackgroundMigrationWorker.perform_bulk( - ['BackgroundMigrationClassName', [1]], - ['BackgroundMigrationClassName', [2]], - ... + [['BackgroundMigrationClassName', [1]], + ['BackgroundMigrationClassName', [2]]] ) ``` @@ -68,6 +67,16 @@ consuming migrations it's best to schedule a background job using an updates. Removals in turn can be handled by simply defining foreign keys with cascading deletes. +If you would like to schedule jobs in bulk with a delay, you can use +`BackgroundMigrationWorker.perform_bulk_in`: + +```ruby +jobs = [['BackgroundMigrationClassName', [1]], + ['BackgroundMigrationClassName', [2]]] + +BackgroundMigrationWorker.perform_bulk_in(5.minutes, jobs) +``` + ## Cleaning Up Because background migrations can take a long time you can't immediately clean |