mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +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
|
||||
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…
x
Reference in New Issue
Block a user