Revert "DEV: increase lock timeout for multisite migration (#14831)" (#14883)

Revert “DEV: increase lock timeout for multisite migration (#14831)” (#14883)

  • Revert “DEV: increase lock timeout for multisite migration (#14831)”

This partially reverts commit 337ef60303bbc20619004fc6e5daa284eb59383c.

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

diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index fa5e26d..8d0c370 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -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

GitHub sha: 69ec6899f981880520cd585410c919f48731954f

This commit appears in #14883 which was approved by davidtaylorhq. It was merged by OsamaSayegh.