mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Small speed up to read-only database sessions (#118674)
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user