Add shutdown guard to Recorder pool in case there is no connection (#68407)

This commit is contained in:
J. Nick Koston
2022-03-20 01:28:44 -10:00
committed by GitHub
parent 3150915cb7
commit 6ffef8373b

View File

@@ -37,7 +37,7 @@ class RecorderPool(SingletonThreadPool, NullPool):
def shutdown(self):
"""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()
def dispose(self):