Skip to content

Commit

Permalink
fix: changed to pessimistic pool_pre_ping
Browse files Browse the repository at this point in the history
We had been seeing

```
(MySQLdb.OperationalError) (2006, 'Server has gone away').
```

To deal we are changing from `pool_recycle` to `pool_pre_ping`.
  • Loading branch information
niquerio committed Dec 9, 2024
1 parent ce86f56 commit bc6ce10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aim/digifeeds/database/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bc6ce10

Please sign in to comment.