Files
discourse/lib/tasks
Alan Guo Xiang Tan 790dc4a5ed DEV: Resupport running multisite:migrate concurrently (#36853)
Previously, we were using multiple threads to run migrations for
multisite setups in parallel. However, it was discovered that
`db:migrate` is
not threadsafe and was not designed to be. As a result,
`multisite:migrate` was hardcoded to only support spinning up a single
thread.

This new attempt Uses the `parallel` gem with `in_processes` to run
migrations concurrently using multiple processes. Concurrency defaults
to 2 but can be configured via the
`DISCOURSE_MULTISITE_MIGRATE_CONCURRENCY` env. Example:
`DISCOURSE_MULTISITE_MIGRATE_CONCURRENCY=5 bin/rails multisite:migrate`
2026-03-05 10:06:13 +08:00
..
2023-08-10 13:59:13 +02:00
2022-04-28 11:51:03 +02:00
2020-09-03 12:10:11 +01:00
2023-08-10 13:59:13 +02:00
2024-11-20 14:36:44 +01:00
2023-08-10 13:59:13 +02:00