From e5b1657ab30f5b8b05840b74de8c8995ee3982a8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 20 Jun 2021 12:54:05 +0200 Subject: [PATCH] Properly remove rpc handler --- freqtrade/rpc/api_server/webserver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/api_server/webserver.py b/freqtrade/rpc/api_server/webserver.py index 5a59883ea..e9becc936 100644 --- a/freqtrade/rpc/api_server/webserver.py +++ b/freqtrade/rpc/api_server/webserver.py @@ -76,7 +76,6 @@ class ApiServer(RPCHandler): Attach rpc handler """ if not self._has_rpc: - self._rpc = rpc ApiServer._rpc = rpc ApiServer._has_rpc = True else: @@ -85,7 +84,9 @@ class ApiServer(RPCHandler): def cleanup(self) -> None: """ Cleanup pending module resources """ - if self._server: + ApiServer._has_rpc = False + del ApiServer._rpc + if self._server and not self._standalone: logger.info("Stopping API Server") self._server.cleanup()