logger.debug("Updating last_instance_fetch for domain='%s' ...", domain)
instances.set_last_instance_fetch(domain)
- logger.debug("Fetching instances for domain='%s',software='%s',origin='%s'", domain, software, origin)
- peerlist = fetch_peers(domain, software, origin)
+ peerlist = list()
+ try:
+ logger.debug("Fetching instances for domain='%s',software='%s',origin='%s'", domain, software, origin)
+ peerlist = fetch_peers(domain, software, origin)
+ except network.exceptions as exception:
+ logger.warning("Cannot fetch peers from domain='%s': '%s'", domain, type(exception))
logger.debug("peerlist[]='%s'", type(peerlist))
if isinstance(peerlist, list):
instances.set_total_peers(domain, peerlist)
logger.debug("peerlist[]='%s'", type(peerlist))
- if peerlist is None:
+ if peerlist is None or len(peerlist) == 0:
logger.warning("Cannot fetch peers: domain='%s'", domain)
logger.debug("Invoking cookies.clear(%s) ...", domain)