diff --git a/app/models/global_setting.rb b/app/models/global_setting.rb index 48d60718036..33535335d7c 100644 --- a/app/models/global_setting.rb +++ b/app/models/global_setting.rb @@ -92,7 +92,7 @@ class GlobalSetting def self.database_config hash = { "adapter" => "postgresql" } - %w{pool timeout socket host port username password replica_host replica_port}.each do |s| + %w{pool connect_timeout timeout socket host port username password replica_host replica_port}.each do |s| if val = self.send("db_#{s}") hash[s] = val end diff --git a/config/discourse_defaults.conf b/config/discourse_defaults.conf index 2f47f7ea21d..cede9cbeaea 100644 --- a/config/discourse_defaults.conf +++ b/config/discourse_defaults.conf @@ -17,9 +17,12 @@ # connection pool size, sidekiq is set to 5, allowing an extra 3 for bg threads db_pool = 8 -# database timeout in milliseconds +# ActiveRecord connection pool timeout in milliseconds db_timeout = 5000 +# Database connection timoue in seconds +db_connect_timeout = 5 + # socket file used to access db db_socket =