Add CONN_MAX_AGE to database connection settings

Defaulting to 300 seconds for the database connection to avoid new connection setup roundtrip on consecutive requests
This commit is contained in:
Stefan de Kooter 2019-11-06 10:24:15 +01:00 committed by GitHub
parent 8d71d2f973
commit 773ec630b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,8 @@ DATABASE = {
# PostgreSQL password
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
'CONN_MAX_AGE': int(os.environ.get('DB_CONN_MAX_AGE', '300')),
# Database connection persistence
}
# This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.