From e826c669ab8c86cfa3f8a6075b4aea2f6c25957d Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Tue, 16 Aug 2022 09:44:56 +0500 Subject: [PATCH] Clean cli stream if not setup connection. --- core/script/cli/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/script/cli/base.py b/core/script/cli/base.py index a34b880183..4aa8d65139 100644 --- a/core/script/cli/base.py +++ b/core/script/cli/base.py @@ -84,10 +84,14 @@ class BaseCLI(object): except ConnectionRefusedError: self.logger.debug("Connection refused") metrics["cli_connection_refused", ("proto", self.name)] += 1 + # Check connection by stream exist, that delete it + self.stream = None raise ConnectionRefusedError except TimeoutError: self.logger.debug("Connection timeout") metrics["cli_connection_timeout", ("proto", self.name)] += 1 + # Check connection by stream exist, that delete it + self.stream = None raise ConnectionRefusedError("Connection timeout") self.logger.debug("Connected") await self.stream.startup() -- GitLab