diff --git a/core/script/cli/base.py b/core/script/cli/base.py index a34b880183b519755395c740a85dca1f851f5eff..4aa8d65139507c004247f00b2003c80e520bca6b 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()