From: Roland Häder Date: Sun, 25 Jun 2023 15:43:56 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c035478f6f2c13375ab4b5c18ac94394daaade39;p=fba.git Continued: - debug message added --- diff --git a/fba/http/federation.py b/fba/http/federation.py index 7d5d97c..2fa7561 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -190,6 +190,8 @@ def fetch_peers(domain: str, software: str, origin: str) -> list: elif "json" in data and len(data["json"]) > 0: logger.debug("Querying API path='%s' was successful: domain='%s',data[json][%s]()=%d", path, domain, type(data['json']), len(data['json'])) peers = data["json"] + + logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) break @@ -304,6 +306,8 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: if "error_message" not in data: nodeinfo = data["json"] + + logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) logger.debug("Found entries: nodeinfo()=%d,domain='%s'", len(nodeinfo), domain) @@ -339,6 +343,8 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: logger.debug("Found JSON data()=%d", len(data)) instances.set_detection_mode(domain, "AUTO_DISCOVERY") instances.set_nodeinfo_url(domain, link["href"]) + + logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) break else: diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index 288280b..c866481 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -67,6 +67,8 @@ def fetch_peers(domain: str, origin: str) -> list: elif "federated_instances" in data["json"] and isinstance(data["json"]["federated_instances"], dict): logger.debug("Found federated_instances for domain='%s'", domain) peers = peers + federation.add_peers(data["json"]["federated_instances"]) + + logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) else: logger.warning("JSON response does not contain 'federated_instances', domain='%s' - trying /instances ...", domain) @@ -235,6 +237,9 @@ def fetch_instances(domain: str, origin: str) -> list: logger.debug("Appending peer='%s' ...", peer) peers.append(peer) + logger.debug("Marking domain='%s' as successfully handled ...") + instances.set_success(domain) + except network.exceptions as exception: logger.warning("domain='%s',exception[%s]:'%s'", domain, type(exception), str(exception)) instances.set_last_error(domain, exception) diff --git a/fba/networks/mastodon.py b/fba/networks/mastodon.py index 9ed961b..7402ee5 100644 --- a/fba/networks/mastodon.py +++ b/fba/networks/mastodon.py @@ -171,6 +171,8 @@ def fetch_blocks(domain: str, nodeinfo_url: str) -> list: else: # Getting blocklist rows = data["json"] + + logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) if len(rows) == 0: diff --git a/fba/utils.py b/fba/utils.py index d7909b5..c62de4b 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -195,7 +195,7 @@ def is_domain_wanted(domain: str) -> bool: logger.debug("domain='%s' is blacklisted - settings False ...", domain) wanted = False elif domain.find("/profile/") > 0 or domain.find("/users/") > 0 or (instances.is_registered(domain.split("/")[0]) and domain.find("/c/") > 0): - loger.debug("domain='%s' is a single user", domain) + logger.debug("domain='%s' is a single user", domain) wanted = False elif domain.find("/tag/") > 0: logger.debug("domain='%s' is a tag", domain)