From aeaaf8935e78b37f31d81358e4e18347061ebbf5 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 12 Apr 2021 12:15:59 +1000 Subject: [PATCH] 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? --- config/database.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.yml b/config/database.yml index 617ee5ae93..1a149be442 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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') %>