Roznoshchik / Lurnby

A tool for active reading and personal knowledge management
https://www.lurnby.com
BSD 3-Clause "New" or "Revised" License
673 stars 17 forks source link

Update Config.py w/ SQLAlchemy Pool PrePing #31

Closed sharedphysics closed 1 year ago

sharedphysics commented 1 year ago

Add SQLALCHEMY_ENGINE_OPTIONS = {"pool_pre_ping": True} to config.py to solve for issue identified here: https://github.com/Roznoshchik/Lurnby/issues/30

To test, leave a page open for a long time (a day? 6h? Depends on your db settings) and then try to do something on that page. Before this fix, it should fail. After this fix, it should be fine.

Roznoshchik commented 1 year ago

You're right. Sleepy morning. This config is passed into the flask app, and Flask sql-alchemy will pull out these variables there.