Fiabiliser les connexions MariaDB
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
This commit is contained in:
parent
a548612219
commit
7e5fe00384
1 changed files with 7 additions and 0 deletions
|
|
@ -11,6 +11,13 @@ class Config:
|
||||||
'mysql+pymysql://gmao:***@/gmao_db?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4'
|
'mysql+pymysql://gmao:***@/gmao_db?unix_socket=/var/run/mysqld/mysqld.sock&charset=utf8mb4'
|
||||||
)
|
)
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
|
# Les watchdogs peuvent monopoliser une connexion pendant le traitement
|
||||||
|
# de grosses pièces jointes. Vérifier/recycler les connexions évite qu'une
|
||||||
|
# requête web réutilise un socket MariaDB déjà fermé.
|
||||||
|
SQLALCHEMY_ENGINE_OPTIONS = {
|
||||||
|
'pool_pre_ping': True,
|
||||||
|
'pool_recycle': 1800,
|
||||||
|
}
|
||||||
SQLALCHEMY_ECHO = os.environ.get('FLASK_DEBUG', '0') == '1'
|
SQLALCHEMY_ECHO = os.environ.get('FLASK_DEBUG', '0') == '1'
|
||||||
TIMEZONE = os.environ.get('TZ', 'Europe/Paris')
|
TIMEZONE = os.environ.get('TZ', 'Europe/Paris')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue