Skip to content

Commit

Permalink
Fix validator error
Browse files Browse the repository at this point in the history
  • Loading branch information
imWildCat committed Apr 29, 2018
1 parent 7849bd9 commit 1123cc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scylla/validator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import math

import requests

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1123cc2

Please sign in to comment.