From: Roland Häder Date: Mon, 29 May 2023 20:32:24 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d174503531dc22ccd65eac139b7e16506471e83a;p=fba.git Continued: - no need for updating last_instance_fetc/last_nodeinfo here --- diff --git a/fba.py b/fba.py index 733809a..d4f13b1 100644 --- a/fba.py +++ b/fba.py @@ -520,6 +520,7 @@ def get_peers(domain: str, software: str) -> list: print(f"WARNING: post_json_api() returned error: {fetched['error']['message']}") update_last_error(domain, fetched["error"]["message"]) break + for row in fetched: # DEBUG: print(f"DEBUG: row():{len(row)}") if not "host" in row: @@ -532,6 +533,7 @@ def get_peers(domain: str, software: str) -> list: # DEBUG: print(f"DEBUG: Adding peer: '{row['host']}'") peers.append(row["host"]) + #print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") update_last_instance_fetch(domain) # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) @@ -560,6 +562,7 @@ def get_peers(domain: str, software: str) -> list: except BaseException as e: print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(e)}]:'{str(e)}'") + #print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") update_last_instance_fetch(domain) # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) @@ -598,10 +601,11 @@ def get_peers(domain: str, software: str) -> list: except BaseException as e: print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(e)}]:'{str(e)}'") - update_last_instance_fetch(domain) + #print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") + update_last_instance_fetch(domain) - # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) - return peers + # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) + return peers # DEBUG: print(f"DEBUG: Fetching get_peers_url='{get_peers_url}' from '{domain}' ...") try: @@ -636,6 +640,7 @@ def get_peers(domain: str, software: str) -> list: print("WARNING: Some error during get():", domain, e) update_last_error(domain, e) + #print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") update_last_instance_fetch(domain) # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) @@ -652,8 +657,6 @@ def post_json_api(domain: str, path: str, parameter: str, extra_headers: dict = if not res.ok or res.status_code >= 400: print(f"WARNING: Cannot query JSON API: domain='{domain}',path='{path}',parameter()={len(parameter)},res.status_code='{res.status_code}',data[]='{type(data)}'") update_last_error(domain, res) - else: - update_last_nodeinfo(domain) except BaseException as e: print(f"WARNING: Some error during post(): domain='{domain}',path='{path}',parameter()={len(parameter)},exception[{type(e)}]:'{str(e)}'") @@ -1236,6 +1239,9 @@ def get_misskey_blocks(domain: str) -> dict: offset = 0 break + #print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") + update_last_instance_fetch(domain) + # DEBUG: print("DEBUG: Returning for domain,blocked(),suspended():", domain, len(blocks["blocked"]), len(blocks["suspended"])) return { "reject" : blocks["blocked"],