mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 10:02:30 +03:00
757bceeb95
# Description closes #2782. Changes `sqlalchemy` connection pooling config : - **pool_pre_ping=True** : pessimistic disconnect handling. > - It is critical to note that the pre-ping approach does not accommodate **for connections dropped in the middle of transactions or other SQL operations** ! But this should only happen if we lose the database either due to network of DB server restart. - **pool_size=10**, with no db side pooling for now, if 6 uvicorn process workers are spawned (or 6 instances of the backed) we have a pool of 60 processes connecting to the database. - **pool_recycle=1800** : Recycles the pool every 30min Added additional session config : - expire_on_commit=False, When True, all instances will be fully expired after each commit, so that all attribute/object access subsequent to a completed transaction will load from the most recent database state. - autoflush=False, query operations will issue a Session.flush() call to this Session before proceeding. We are calling `session.commit` (which flushes) on each repository method so ne need to reflush on subsequent access |
||
---|---|---|
.. | ||
middlewares | ||
models | ||
modules | ||
packages | ||
playground | ||
routes | ||
vectorstore | ||
__init__.py | ||
celery_config.py | ||
celery_worker.py | ||
logger.py | ||
main.py |