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:
# 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))
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))
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:
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))
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)}'")
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"],