mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add shutdown guard to Recorder pool in case there is no connection (#68407)
This commit is contained in:
parent
3150915cb7
commit
6ffef8373b
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user