mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-22 12:50:27 +00:00
sendGraph: Only print each fetch line when given -v
Otherwise it clutters up the logs a bit much. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
This commit is contained in:
parent
6581021581
commit
f3142582f5
@ -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,6 +83,7 @@ def worker(nodes, get_peer_queue, result):
|
|||||||
return
|
return
|
||||||
|
|
||||||
node = nodes[k]
|
node = nodes[k]
|
||||||
|
if verbose:
|
||||||
print('fetch', node)
|
print('fetch', node)
|
||||||
node_ip = node['ip']
|
node_ip = node['ip']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user