From 55bd7db022351cc9b5b0884c1c2841abfdc6ec33 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 10 Aug 2023 21:23:57 +0200 Subject: [PATCH] Don't forget to close WS session --- freqtrade/exchange/exchange.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 2e8ff3ec4..8fb041c48 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -271,6 +271,11 @@ class Exchange: ): logger.debug("Closing async ccxt session.") self.loop.run_until_complete(self._api_async.close()) + if (self._ws_async and inspect.iscoroutinefunction(self._ws_async.close) + and self._ws_async.session): + logger.debug("Closing ws ccxt session.") + self.loop.run_until_complete(self._ws_async.close()) + if self.loop and not self.loop.is_closed(): self.loop.close()