added timeout to performget
This commit is contained in:
parent
8b3a09f5af
commit
aaecd0adaf
@ -159,7 +159,7 @@ class OnionrCommunicate:
|
||||
if data != None:
|
||||
url = url + '&data=' + data
|
||||
try:
|
||||
r = requests.get(url, headers=headers, proxies=proxies)
|
||||
r = requests.get(url, headers=headers, proxies=proxies, timeout=(5, 30))
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.warn(action + " failed with peer " + peer + ": " + str(e))
|
||||
return False
|
||||
|
@ -166,6 +166,7 @@ class Core:
|
||||
dataHash = dataHash.decode()
|
||||
blockFileName = self.blockDataLocation + dataHash + '.dat'
|
||||
if os.path.exists(blockFileName):
|
||||
return # to do, properly check if block is already saved elsewhere
|
||||
raise Exception("Data is already set for " + dataHash)
|
||||
else:
|
||||
blockFile = open(blockFileName, 'w')
|
||||
|
Loading…
Reference in New Issue
Block a user