From 0b9e52c8ccaae3e88a347f284af4bd3f809dc459 Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Mon, 9 Dec 2024 15:28:03 +0000 Subject: [PATCH] changed to pessemistic pool_pre_ping to deal with "the server has gone away" error --- 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)