Skip to content

Commit 773ec63

Browse files
authored
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
1 parent 8d71d2f commit 773ec63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

configuration/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def read_secret(secret_name):
3737
# PostgreSQL password
3838
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
3939
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
40+
'CONN_MAX_AGE': int(os.environ.get('DB_CONN_MAX_AGE', '300')),
41+
# Database connection persistence
4042
}
4143

4244
# This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.

0 commit comments

Comments
 (0)