From 08cdb0e3eee769e393d6017671dc129331301961 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 19 Feb 2023 12:20:01 -0600 Subject: [PATCH] Fix recorder LRU being destroyed if event session is reopened (#88448) --- homeassistant/components/recorder/core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/recorder/core.py b/homeassistant/components/recorder/core.py index 7cd0ad56f79..a6ec512a9f2 100644 --- a/homeassistant/components/recorder/core.py +++ b/homeassistant/components/recorder/core.py @@ -1027,11 +1027,11 @@ class Recorder(threading.Thread): def _close_event_session(self) -> None: """Close the event session.""" - self._old_states = {} - self._state_attributes_ids = {} - self._event_data_ids = {} - self._pending_state_attributes = {} - self._pending_event_data = {} + self._old_states.clear() + self._state_attributes_ids.clear() + self._event_data_ids.clear() + self._pending_state_attributes.clear() + self._pending_event_data.clear() if not self.event_session: return