Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(db): database connection errors (#56)
This is an attempted fix for the databases connections errors at high load. Specifically, the error, `OperationalError: could not connect to server: Connection refused`. The fix includes the following changes: 1. Performing health checks on existing connections on each request. 2. Disable Atomic requests on every view. 3. Increasing the maximum duration of a db connection to 3 minutes. (This is done using an environment variable on the deployment platforms). This is a temporary fix and might have a minimal impact or not solve the problem. A proper fix might be implementing proper database connection pooling using tools such as [pgbouncer](https://www.pgbouncer.org). Included are also other minor fixes and improvements.
- Loading branch information