]> git.mxchange.org Git - fba.git/blobdiff - fba.py
Continued:
[fba.git] / fba.py
diff --git a/fba.py b/fba.py
index 733809ae5df61dd76f3480e033c9cb025a98d89e..d4f13b161671c716bd1f31601f1d7e0221b448a8 100644 (file)
--- 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"],