From: Roland Häder Date: Wed, 28 Jun 2023 04:43:21 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28f2a35b1c258d2d7a3b567c5cd727f6ff70da95;p=fba.git Continued: - update instance data just before exiting federation.fetch_instances() --- diff --git a/fba/commands.py b/fba/commands.py index a915596..8812cf1 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -713,6 +713,7 @@ def fetch_instances(args: argparse.Namespace) -> int: except network.exceptions as exception: logger.warning("Exception '%s' during fetching instances (fetch_instances) from args.domain='%s'", type(exception), args.domain) instances.set_last_error(args.domain, exception) + instances.update_data(args.domain) return 100 if args.single: diff --git a/fba/http/federation.py b/fba/http/federation.py index 630b87b..844fe28 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -90,11 +90,6 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: logger.debug("Invoking instances.set_total_peerlist(%s,%d) ...", domain, len(peerlist)) instances.set_total_peers(domain, peerlist) - logger.debug("Checking if domain='%s' has pending updates ...", domain) - if instances.has_pending(domain): - logger.debug("Flushing updates for domain='%s' ...", domain) - instances.update_data(domain) - logger.debug("peerlist[]='%s'", type(peerlist)) if peerlist is None: logger.warning("Cannot fetch peers: domain='%s'", domain) @@ -135,6 +130,11 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: logger.debug("Invoking cookies.clear(%s) ...", domain) cookies.clear(domain) + logger.debug("Checking if domain='%s' has pending updates ...", domain) + if instances.has_pending(domain): + logger.debug("Flushing updates for domain='%s' ...", domain) + instances.update_data(domain) + logger.debug("EXIT!") def fetch_peers(domain: str, software: str, origin: str) -> list: