Small speed up to read-only database sessions (#118674)
This commit is contained in:
parent
f9dff1632e
commit
588380392d
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ def session_scope(
|
|||
need_rollback = False
|
||||
try:
|
||||
yield session
|
||||
if session.get_transaction() and not read_only:
|
||||
if not read_only and session.get_transaction():
|
||||
need_rollback = True
|
||||
session.commit()
|
||||
except Exception as err:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue