1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 04:38:24 +02: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

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
}
}
# Connections expire after 10 seconds
CONN_MAX_AGE = 10
CONN_HEALTH_CHECKS = True
else:
DATABASES = {
'default': {