mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:06:26 +08:00
* Revert "DEV: increase lock timeout for multisite migration (#14831)"
This partially reverts commit 337ef60303
.
We need to revert the mutex around `db:status:json` because the mutex is not available unless the rails environment is loaded which the `db:status:json` doesn't load before the mutex. We can't load the environment before entering the mutex because the mutex is meant to prevent other instances of the task from loading a rails environment while the database is migrating.
Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
parent
095255c8ec
commit
69ec6899f9
|
@ -548,14 +548,12 @@ end
|
|||
|
||||
desc 'Check that the DB can be accessed'
|
||||
task 'db:status:json' do
|
||||
DistributedMutex.synchronize('db_migration', redis: Discourse.redis.without_namespace, validity: 1200) do
|
||||
begin
|
||||
Rake::Task['environment'].invoke
|
||||
DB.query('SELECT 1')
|
||||
rescue
|
||||
puts({ status: 'error' }.to_json)
|
||||
else
|
||||
puts({ status: 'ok' }.to_json)
|
||||
end
|
||||
begin
|
||||
Rake::Task['environment'].invoke
|
||||
DB.query('SELECT 1')
|
||||
rescue
|
||||
puts({ status: 'error' }.to_json)
|
||||
else
|
||||
puts({ status: 'ok' }.to_json)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user