dht_crawler: only count non zero connections

This commit is contained in:
Victor Shyba 2022-06-20 06:07:05 -03:00 committed by Victor Shyba
parent cfe5c8de8a
commit 62eb9d5c75

View file

@ -260,7 +260,8 @@ class Crawler:
log.info("Done querying %s:%d in %.2f seconds: %d peers found over %d requests.", log.info("Done querying %s:%d in %.2f seconds: %d peers found over %d requests.",
host, port, (time.time() - start), len(peers), i) host, port, (time.time() - start), len(peers), i)
self.add_peers(*peers) self.add_peers(*peers)
self.connections_found_metric.labels(host=host, port=port).set(len(peers)) if peers:
self.connections_found_metric.labels(host=host, port=port).set(len(peers))
#self.associate_peers(this_peer_id, db_peer_ids) #self.associate_peers(this_peer_id, db_peer_ids)
self.db.commit() self.db.commit()
return peers return peers