mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac: get_db_context
This commit is contained in:
parent
614cb56420
commit
2bb13d5dbc
1 changed files with 1 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ get_db = contextmanager(get_session)
|
|||
|
||||
@contextmanager
|
||||
def get_db_context(db: Optional[Session] = None):
|
||||
if db:
|
||||
if isinstance(db, Session):
|
||||
yield db
|
||||
else:
|
||||
with get_db() as session:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue