Small speed up to read-only database sessions (#118674)

This commit is contained in:
J. Nick Koston
2024-06-03 12:50:05 -05:00
committed by GitHub
parent f9dff1632e
commit 588380392d

View File

@@ -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: