Skip to content

Commit

Permalink
Update Client.py (#82)
Browse files Browse the repository at this point in the history
Add timeout to all RPC calls
  • Loading branch information
i25959341 authored and f27d committed Aug 20, 2018
1 parent fd8769c commit 2d1f9b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neo-collector/insert/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def __init__(self, client, address):

def setup(self):

response = requests.post(self.addr, json={'jsonrpc': '2.0', 'method': GET_BLOCK_COUNT, 'params': [], 'id': 1})
response = requests.post(self.addr, json={'jsonrpc': '2.0', 'method': GET_BLOCK_COUNT, 'params': [], 'id': 1}, timeout=TIMEOUT)
self.update_endpoint_details(response)

if response.status_code == 200:
Expand Down Expand Up @@ -421,4 +421,4 @@ def __ge__(self, other):
return self._compare(other) >= 0

def __str__(self):
return "[%s] %s %s %s" % (self.addr, self.status, self.height, self.elapsed)
return "[%s] %s %s %s" % (self.addr, self.status, self.height, self.elapsed)

0 comments on commit 2d1f9b0

Please sign in to comment.