chore: Sets sqlalchemy pool_size and max overflow to a hard limit instead of default values (#1133)
<!-- .github/pull_request_template.md --> ## Description Sets sqlalchemy pool_size and max overflow to a hard limit instead of default values ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
parent
f77183d001
commit
1135a5e44d
1 changed files with 10 additions and 3 deletions
|
|
@ -49,9 +49,16 @@ class SQLAlchemyAdapter:
|
|||
|
||||
run_sync(self.pull_from_s3())
|
||||
|
||||
self.engine = create_async_engine(
|
||||
connection_string, poolclass=NullPool if "sqlite" in connection_string else None
|
||||
)
|
||||
if "sqlite" in connection_string:
|
||||
self.engine = create_async_engine(
|
||||
connection_string,
|
||||
poolclass=NullPool,
|
||||
)
|
||||
else:
|
||||
self.engine = create_async_engine(
|
||||
connection_string, pool_size=12, max_overflow=12, poolclass=None
|
||||
)
|
||||
|
||||
self.sessionmaker = async_sessionmaker(bind=self.engine, expire_on_commit=False)
|
||||
|
||||
async def push_to_s3(self) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue