mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Small speed up to read-only database sessions (#118674)
This commit is contained in:
parent
f9dff1632e
commit
588380392d
@ -134,7 +134,7 @@ def session_scope(
|
|||||||
need_rollback = False
|
need_rollback = False
|
||||||
try:
|
try:
|
||||||
yield session
|
yield session
|
||||||
if session.get_transaction() and not read_only:
|
if not read_only and session.get_transaction():
|
||||||
need_rollback = True
|
need_rollback = True
|
||||||
session.commit()
|
session.commit()
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user