fix: further improve exchange.close fix

pull/12827/head
Matthias 4 days ago
parent 93d2397f72
commit 5d3c798dfd

@ -314,9 +314,10 @@ class Exchange:
if self._exchange_ws:
self._exchange_ws.cleanup()
logger.debug("Exchange object destroyed, closing async loop")
loop_running = (
getattr(self, "loop", None) and self.loop.is_running()
) or asyncio.get_event_loop().is_running()
generic_loop = asyncio.get_event_loop()
loop_running = (getattr(self, "loop", None) and self.loop.is_running()) or (
generic_loop and generic_loop.is_running()
)
if (
getattr(self, "_api_async", None)

Loading…
Cancel
Save