[password-resets] SQLAlchemy connections tuning for liveness checks / connection recycling (https://medium.com/@heyjcm
- From: Andrea Veri <averi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [password-resets] SQLAlchemy connections tuning for liveness checks / connection recycling (https://medium.com/@heyjcm
- Date: Thu, 12 Nov 2020 22:29:52 +0000 (UTC)
commit aefd420ec87ab051289670cbb00309a61acaa3d7
Author: Andrea Veri <averi redhat com>
Date: Thu Nov 12 23:29:45 2020 +0100
SQLAlchemy connections tuning for liveness checks / connection recycling
(https://medium.com/@heyjcmc/controlling-the-flask-sqlalchemy-engine-a0f8fae15b47)
db/base.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/db/base.py b/db/base.py
index ab4bf49..429b519 100644
--- a/db/base.py
+++ b/db/base.py
@@ -17,7 +17,9 @@ DATABASE = 'mysql+pymysql://%s:%s@%s:%s/%s?charset=utf8' % (
ENGINE = create_engine(
DATABASE,
encoding="utf-8",
- echo=True
+ echo=True,
+ pool_pre_ping=True,
+ pool_recycle=3600,
)
Session = scoped_session(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]