Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Disable sqlalchemy connection pooling (#18)
Browse files Browse the repository at this point in the history
* Disable sqlalchemy connection pooling

Signed-off-by: Alex Co <alex.tuan@mindvalley.com>

* Formatting code

Signed-off-by: Alex Co <alex.tuan@mindvalley.com>

---------

Signed-off-by: Alex Co <alex.tuan@mindvalley.com>
  • Loading branch information
onimsha authored Apr 22, 2024
1 parent c4af552 commit b4cca06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/danswer/db/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy.orm import Session
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import NullPool

from danswer.configs.app_configs import POSTGRES_DB
from danswer.configs.app_configs import POSTGRES_HOST
Expand Down Expand Up @@ -61,7 +62,7 @@ def get_sqlalchemy_engine() -> Engine:
if _SYNC_ENGINE is None:
connection_string = build_connection_string(db_api=SYNC_DB_API)
_SYNC_ENGINE = create_engine(
connection_string, pool_size=50, max_overflow=25, connect_args=connect_args
connection_string, poolclass=NullPool, connect_args=connect_args
)
return _SYNC_ENGINE

Expand Down

0 comments on commit b4cca06

Please sign in to comment.