logger.info("Checking %d relays ...", len(rows))
for row in rows:
logger.debug("row[domain]='%s',row[software]='%s' ...", row["domain"], row["software"])
+ peers = list()
if not args.force and instances.is_recent(row["domain"]):
logger.debug("row[domain]='%s' has been recently fetched - SKIPPED!", row["domain"])
continue
if domain == "":
logger.debug("Empty domain after tidyup.domain() from origin='%s' - SKIPPED!", row["domain"])
continue
- elif instances.is_registered(domain):
- logger.debug("domain='%s' is already registered - SKIPPED!", domain)
- continue
- elif dict_helper.has_key(domains, "domain", domain):
+ elif domain not in peers:
+ logger.debug("Appending domain='%s' to peers list for relay='%s' ...", domain, row["domain"])
+ peers.append(domain)
+
+ if dict_helper.has_key(domains, "domain", domain):
logger.debug("domain='%s' already added", domain)
continue
if domain == "":
logger.debug("Empty domain after tidyup.domain() from origin='%s' - SKIPPED!", row["domain"])
continue
- elif instances.is_registered(domain):
- logger.debug("domain='%s' is already registered - SKIPPED!", domain)
- continue
- elif dict_helper.has_key(domains, "domain", domain):
+ elif domain not in peers:
+ logger.debug("Appending domain='%s' to peers list for relay='%s' ...", domain, row["domain"])
+ peers.append(domain)
+
+ if dict_helper.has_key(domains, "domain", domain):
logger.debug("domain='%s' already added", domain)
continue
logger.debug("Updating last_instance_fetch for row[domain]='%s' ...", row["domain"])
instances.set_last_instance_fetch(row["domain"])
+
+ logger.info("Relay '%s' has %d peer(s) registered.", row["domain"], len(peers))
+ instances.set_total_peers(row["domain"], peers)
+
+ logger.debug("Flushing data for row[domain]='%s'", row["domain"])
instances.update_data(row["domain"])
- logger.info("Found %d domains to add ...", len(domains))
+ logger.info("Checking %d domains ...", len(domains))
for row in domains:
+ logger.debug("row[domain]='%s',row[origin]='%s'", row["domain"], row["origin"])
+ if instances.is_registered(row["domain"]):
+ logger.debug("row[domain]='%s' is already registered - SKIPPED!", row["domain"])
+ continue
+
logger.info("Fetching row[domain]='%s',row[origin]='%s' ...", row["domain"], row["origin"])
federation.fetch_instances(row["domain"], row["origin"], None, inspect.currentframe().f_code.co_name)