diff --git a/scylla/validator.py b/scylla/validator.py index 3bf0ced..6638eab 100644 --- a/scylla/validator.py +++ b/scylla/validator.py @@ -1,4 +1,5 @@ import json +import math import requests @@ -41,7 +42,10 @@ def __init__(self, host: str, port: int, using_ssl: bool = False): self._meta = None def validate_latency(self): - (self._latency, self._success_rate) = ping(self._host, self._port) + try: + (self._latency, self._success_rate) = ping(self._host, self._port) + except ConnectionRefusedError: + self._latency, self._success_rate = math.inf, 0.0 def validate_proxy(self): proxy_str = 'http://{}:{}'.format(self._host, self._port)