mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-25 20:31:35 +00:00
Merge pull request #9 from kyrias/sG-fixes
sendGraph: Only print each fetch line when given -v
This commit is contained in:
commit
079796d999
@ -31,6 +31,7 @@ cjdns_password = 'NONE'
|
|||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import json
|
import json
|
||||||
|
import argparse
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -42,6 +43,12 @@ import queue
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Submit nodes and links to fc00')
|
||||||
|
parser.add_argument('-v', '--verbose', help='increase output verbosity',
|
||||||
|
dest='verbose', action='store_true')
|
||||||
|
parser.set_defaults(verbose=False)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
con = connect()
|
con = connect()
|
||||||
|
|
||||||
nodes = dump_node_store(con)
|
nodes = dump_node_store(con)
|
||||||
@ -54,7 +61,8 @@ def main():
|
|||||||
get_peer_queue.put(k)
|
get_peer_queue.put(k)
|
||||||
|
|
||||||
for i in range(8):
|
for i in range(8):
|
||||||
t = threading.Thread(target=worker, args=[nodes, get_peer_queue, result_queue])
|
t = threading.Thread(target=worker, args=[nodes, get_peer_queue, result_queue,
|
||||||
|
args.verbose])
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
@ -65,7 +73,7 @@ def main():
|
|||||||
send_graph(nodes, edges)
|
send_graph(nodes, edges)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def worker(nodes, get_peer_queue, result):
|
def worker(nodes, get_peer_queue, result, verbose=False):
|
||||||
con = connect()
|
con = connect()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@ -75,7 +83,8 @@ def worker(nodes, get_peer_queue, result):
|
|||||||
return
|
return
|
||||||
|
|
||||||
node = nodes[k]
|
node = nodes[k]
|
||||||
print('fetch', node)
|
if verbose:
|
||||||
|
print('fetch', node)
|
||||||
node_ip = node['ip']
|
node_ip = node['ip']
|
||||||
|
|
||||||
peers = get_peers(con, node['path'])
|
peers = get_peers(con, node['path'])
|
||||||
|
Loading…
Reference in New Issue
Block a user