mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:42:24 +00:00
Close database connections after 10 seconds (experimental)
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
505a94e3aa
commit
6ac36fdb69
@ -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': {
|
||||||
|
Loading…
Reference in New Issue
Block a user