Files
leadchat/config/database.yml
Sojan Jose 72f206025a chore: Fix connection pool (#6005)
We want to allocate as much database connection to the pool to match the sidekiq concurrency configuration.
ref: https://maxencemalbois.medium.com/the-ruby-on-rails-database-connections-pool-4ce1099a9e9f

fixes: #6004
2023-01-16 17:50:23 +05:30

26 lines
995 B
YAML

default: &default
adapter: postgresql
encoding: unicode
host: <%= ENV.fetch('POSTGRES_HOST', 'localhost') %>
port: <%= ENV.fetch('POSTGRES_PORT', '5432') %>
# ref: https://github.com/mperham/sidekiq/issues/2985#issuecomment-531097962
pool: <%= Sidekiq.server? ? Sidekiq.options[:concurrency] : ENV.fetch('RAILS_MAX_THREADS', 5) %>
development:
<<: *default
database: <%= ENV.fetch('POSTGRES_DATABASE', 'chatwoot_dev') %>
username: <%= ENV.fetch('POSTGRES_USERNAME', 'postgres') %>
password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
test:
<<: *default
database: <%= ENV.fetch('POSTGRES_DATABASE', 'chatwoot_test') %>
username: <%= ENV.fetch('POSTGRES_USERNAME', 'postgres') %>
password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
production:
<<: *default
database: <%= ENV.fetch('POSTGRES_DATABASE', 'chatwoot_production') %>
username: <%= ENV.fetch('POSTGRES_USERNAME', 'chatwoot_prod') %>
password: <%= ENV.fetch('POSTGRES_PASSWORD', 'chatwoot_prod') %>