DEV: Switch to db config to disable advisory locks.

This commit is contained in:
Guo Xiang Tan 2020-06-15 14:33:30 +08:00
parent 35a157619a
commit d8cd912769
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
3 changed files with 3 additions and 10 deletions

View File

@ -151,6 +151,7 @@ class GlobalSetting
hash["prepared_statements"] = !!self.db_prepared_statements
hash["idle_timeout"] = connection_reaper_age if connection_reaper_age.present?
hash["reaping_frequency"] = connection_reaper_interval if connection_reaper_interval.present?
hash["advisory_locks"] = !!self.db_advisory_locks
{ "production" => hash }
end

View File

@ -59,6 +59,8 @@ db_replica_host =
# port running replica db server, defaults to 5432 if not set
db_replica_port =
db_advisory_locks = true
# hostname running the forum
hostname = "www.example.com"

View File

@ -1,10 +0,0 @@
# frozen_string_literal: true
# Awaiting decision on https://github.com/rails/rails/issues/31190
if ENV['DISABLE_MIGRATION_ADVISORY_LOCK']
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
def supports_advisory_locks?
false
end
end
end