1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 18:22:23 +00:00

Close database connections after 10 seconds (experimental)

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2023-04-07 22:02:37 +02:00
parent 505a94e3aa
commit 6ac36fdb69
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -221,6 +221,10 @@ if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql':
'PORT': os.environ.get('DJANGO_DB_PORT', ''), # Use default port 'PORT': os.environ.get('DJANGO_DB_PORT', ''), # Use default port
} }
} }
# Connections expire after 10 seconds
CONN_MAX_AGE = 10
CONN_HEALTH_CHECKS = True
else: else:
DATABASES = { DATABASES = {
'default': { 'default': {