mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 09:21:39 -05:00
During database upgrades and database fail overs there has been errors because the database connection stays open, when a query is run the query fails and the connection is re-established. To avoid these errors shorter timeouts have been used to keep the connections from getting stale. - SQLALCHEMY_POOL_TIMEOUT timeout idle connections after 30 secs - Updated SQLALCHEMY_POOL_RECYCLE to recycle the connection every 5 mins See guide on optimistic disconnect handling - using the pool recycle as a way to manage this: http://docs.sqlalchemy.org/en/latest/core/pooling.html#disconnect-handling-optimistic