mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
A spec failed with this message:
ActiveRecord::ConnectionTimeoutError:
could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use
The error seems to be raised when trying to authenticate the user
through Devise in a before_action block. Increasing the pool size by one
helped.
I don't know why our app needs more than 5 connections at the same time.
Maybe some gem "forgets" to release connections?
25 lines
563 B
YAML
25 lines
563 B
YAML
defaults: &defaults
|
|
adapter: postgresql
|
|
encoding: unicode
|
|
pool: <%= ENV.fetch('OFN_DB_POOL', 6) %>
|
|
host: <%= ENV.fetch('OFN_DB_HOST', 'localhost') %>
|
|
username: <%= ENV.fetch('OFN_DB_USERNAME', 'ofn') %>
|
|
password: <%= ENV.fetch('OFN_DB_PASSWORD', 'f00d') %>
|
|
port: <%= ENV.fetch('OFN_DB_PORT', 5432) %>
|
|
|
|
development:
|
|
<<: *defaults
|
|
database: open_food_network_dev
|
|
|
|
test:
|
|
<<: *defaults
|
|
database: open_food_network_test
|
|
|
|
production:
|
|
<<: *defaults
|
|
database: open_food_network_prod
|
|
|
|
staging:
|
|
<<: *defaults
|
|
database: open_food_network_prod
|