mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-22 05:50:29 +00:00
commit
573d8260ab
@ -155,8 +155,11 @@ def get_peers(con, path):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if 'result' not in res or res['result'] != 'peers':
|
if 'result' not in res or res['result'] != 'peers':
|
||||||
print('get_peers: failed too many times, skipping.')
|
if 'result' in res and res['result'] == 'timeout':
|
||||||
print(res)
|
print('get_peers: timed out on final try, skipping.')
|
||||||
|
else:
|
||||||
|
print('get_peers: failed too many times, skipping. Last response: {:s}'
|
||||||
|
.format(str(res)))
|
||||||
return peers
|
return peers
|
||||||
|
|
||||||
for peer in res['peers']:
|
for peer in res['peers']:
|
||||||
@ -208,7 +211,7 @@ def send_graph(nodes, edges):
|
|||||||
payload = {'data': json_graph, 'mail': your_mail, 'version': 2}
|
payload = {'data': json_graph, 'mail': your_mail, 'version': 2}
|
||||||
r = requests.post(url, data=payload)
|
r = requests.post(url, data=payload)
|
||||||
|
|
||||||
if r.content == 'OK':
|
if r.text == 'OK':
|
||||||
print('Done!')
|
print('Done!')
|
||||||
else:
|
else:
|
||||||
print('Error: {:s}'.format(r.text))
|
print('Error: {:s}'.format(r.text))
|
||||||
|
Loading…
Reference in New Issue
Block a user