FIX: Disable concurrent migration for `multisite:migrate`.

Rails migration is not thread safe.
This commit is contained in:
Guo Xiang Tan 2020-08-05 15:10:37 +08:00
parent 1d281353b6
commit 850d5696f2
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
1 changed files with 3 additions and 1 deletions

View File

@ -114,7 +114,9 @@ task 'multisite:migrate' => ['db:load_config', 'environment', 'set_locale'] do |
raise "Multisite migrate is only supported in production"
end
concurrency = (ENV['MIGRATE_CONCURRENCY'].presence || "20").to_i
# TODO: Switch to processes for concurrent migrations because Rails migration
# is not thread safe by default.
concurrency = 1
puts "Multisite migrator is running using #{concurrency} threads"
puts