quivr/backend/api/quivr_api
AmineDiro 757bceeb95
fix: asyncpg pooling config fix (#2795)
# 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
2024-07-04 05:28:02 -07:00
..
middlewares feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
models feat: add megaparse (#2785) 2024-07-04 02:23:15 -07:00
modules fix: asyncpg pooling config fix (#2795) 2024-07-04 05:28:02 -07:00
packages feat: add megaparse (#2785) 2024-07-04 02:23:15 -07:00
playground feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
routes feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
vectorstore feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
__init__.py feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
celery_config.py feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
celery_worker.py feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
logger.py feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00
main.py feat(backend): quivr-monorepo and quivr-core package (#2765) 2024-06-27 03:51:01 -07:00