From cbf5b5ead5a20ef7c4f33b60cf81d8bd8d2efa75 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 24 Mar 2022 14:15:09 +0100 Subject: [PATCH] Use recorder threadpool in WS recorder/get_statistics_metadata (#68615) --- homeassistant/components/recorder/websocket_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/websocket_api.py b/homeassistant/components/recorder/websocket_api.py index 241dca9026c..585641665af 100644 --- a/homeassistant/components/recorder/websocket_api.py +++ b/homeassistant/components/recorder/websocket_api.py @@ -82,7 +82,8 @@ async def ws_get_statistics_metadata( hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict ) -> None: """Get metadata for a list of statistic_ids.""" - statistic_ids = await hass.async_add_executor_job( + instance: Recorder = hass.data[DATA_INSTANCE] + statistic_ids = await instance.async_add_executor_job( list_statistic_ids, hass, msg.get("statistic_ids") ) connection.send_result(msg["id"], statistic_ids)