mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix blocking event loop call in matrix (#122730)
Wrap load_json_object in async_add_executor_job
This commit is contained in:
parent
e0a1aaa1b9
commit
015a1a6ebc
@ -349,7 +349,9 @@ class MatrixBot:
|
|||||||
async def _get_auth_tokens(self) -> JsonObjectType:
|
async def _get_auth_tokens(self) -> JsonObjectType:
|
||||||
"""Read sorted authentication tokens from disk."""
|
"""Read sorted authentication tokens from disk."""
|
||||||
try:
|
try:
|
||||||
return load_json_object(self._session_filepath)
|
return await self.hass.async_add_executor_job(
|
||||||
|
load_json_object, self._session_filepath
|
||||||
|
)
|
||||||
except HomeAssistantError as ex:
|
except HomeAssistantError as ex:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Loading authentication tokens from file '%s' failed: %s",
|
"Loading authentication tokens from file '%s' failed: %s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user