Increase DB connection pool size for specs

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?
This commit is contained in:
Maikel Linke
2021-04-12 12:15:59 +10:00
parent d00970e05d
commit aeaaf8935e

View File

@@ -1,7 +1,7 @@
defaults: &defaults
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch('OFN_DB_POOL', 5) %>
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') %>