From bc6ce108d02dd17ab25cf8e3ad45273e013c08cb Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Mon, 9 Dec 2024 15:28:03 +0000 Subject: [PATCH] fix: changed to pessimistic pool_pre_ping We had been seeing ``` (MySQLdb.OperationalError) (2006, 'Server has gone away'). ``` To deal we are changing from `pool_recycle` to `pool_pre_ping`. --- aim/digifeeds/database/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aim/digifeeds/database/main.py b/aim/digifeeds/database/main.py index a45902f..284d5fb 100644 --- a/aim/digifeeds/database/main.py +++ b/aim/digifeeds/database/main.py @@ -14,7 +14,7 @@ if S.ci_on: # pragma: no cover engine = create_engine(S.test_database) else: # pragma: no cover - engine = create_engine(S.mysql_database, pool_recycle=1800) + engine = create_engine(S.mysql_database, pool_pre_ping=True) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)