Skip to content

Commit

Permalink
Fix postgres pool size
Browse files Browse the repository at this point in the history
postgres pool_size and max_overflow were passed when using get_db_manager
but not in the get_db dependency.
Engine was created with the default values of 5 / 10,
instead of 10 / 100 or the values from the config.
  • Loading branch information
beenje committed Aug 21, 2023
1 parent e2a5845 commit 88c25b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quetz/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ def get_config():

def get_db(config: Config = Depends(get_config)):
database_url = config.sqlalchemy_database_url
db = get_db_session(database_url, echo=config.sqlalchemy_echo_sql)
db = get_db_session(
database_url,
echo=config.sqlalchemy_echo_sql,
postgres_kwargs=dict(
pool_size=config.sqlalchemy_postgres_pool_size,
max_overflow=config.sqlalchemy_postgres_max_overflow,
),
)
try:
yield db
finally:
Expand Down

0 comments on commit 88c25b2

Please sign in to comment.