Fix blocking event loop call in matrix (#122730)
Wrap load_json_object in async_add_executor_jobpull/122993/head
parent
e0a1aaa1b9
commit
015a1a6ebc
|
@ -349,7 +349,9 @@ class MatrixBot:
|
|||
async def _get_auth_tokens(self) -> JsonObjectType:
|
||||
"""Read sorted authentication tokens from disk."""
|
||||
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:
|
||||
_LOGGER.warning(
|
||||
"Loading authentication tokens from file '%s' failed: %s",
|
||||
|
|
Loading…
Reference in New Issue