<FromGitter>
<damianham> I keep getting **(DB::PoolRetryAttemptsExceeded)** errors. I restart my production server at 4am every day but as the number of users is increasing this problem is still happening in the early evening when there is peak usage. I also got this problem on my local development instance which has very few requests but runs for a long time. I have just increased the max number of connections in postgres to 300. Is
<FromGitter>
... there anything else I can do to avoid getting this error.
<FromGitter>
<Blacksmoke16> iirc something like this was reported in crystal gitter
<FromGitter>
<damianham> @drujensen @elorest I think the issue might be in granite/src/adapter/base.cr. A database connection is opened and stored in an instance variable rather than yielding the connection to a block and as far as I can see is never closed. The online docs for crystal DB state that you can use a **non yielding DB.open method as long as Database#close is called at the end.** Since DB:Pool takes care of connection pools
<FromGitter>
... is there a need to store the connection in an instance variable?