mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Add shutdown guard to Recorder pool in case there is no connection (#68407)
This commit is contained in:
@@ -37,7 +37,7 @@ class RecorderPool(SingletonThreadPool, NullPool):
|
|||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""Close the connection."""
|
"""Close the connection."""
|
||||||
if self.recorder_or_dbworker and (conn := self._conn.current()):
|
if self.recorder_or_dbworker and self._conn and (conn := self._conn.current()):
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
def dispose(self):
|
def dispose(self):
|
||||||
|
Reference in New Issue
Block a user