headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_peers,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return peers
# DEBUG: print(f"DEBUG: Fetching peers from '{domain}',software='{software}' ...")
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (nodeinfo,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return {
"status_code" : 500,
"error_message": f"exception[{type(exception)}]='{str(exception)}'",
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_wellknown_nodeinfo,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return {
"status_code" : 500,
"error_message": type(exception),
# DEBUG: print(f"DEBUG: Success! (rowcount={fba.cursor.rowcount })")
if fba.cursor.rowcount == 0:
- # DEBUG: print(f"DEBUG: Did not update any rows: domain='{domain}',fields()={len(fields)} - EXIT!")
+ print(f"WARNING: Did not update any rows: domain='{domain}',fields()={len(fields)} - EXIT!")
return
# DEBUG: print("DEBUG: Committing changes ...")
# DEBUG: print("DEBUG: domain,origin,command,path:", domain, origin, command, path)
software = federation.determine_software(domain, path)
except network.exceptions as exception:
- print(f"WARNING Exception '{type(exception)}' during determining software type")
+ print(f"WARNING: Exception '{type(exception)}' during determining software type")
+ set_last_error(domain, exception)
# DEBUG: print("DEBUG: Determined software:", software)
if software == "lemmy" and domain.find("/c/") > 0:
),
)
+ # DEBUG: print(f"DEBUG: Marking domain='{domain}' as registered.")
cache.set_sub_key("is_registered", domain, True)
if has_pending(domain):
# DEBUG: print(f"DEBUG: domain='{domain}' has pending nodeinfo being updated ...")
- _set_data("last_status_code" , domain, None)
- _set_data("last_error_details", domain, None)
update_data(domain)
# DEBUG: print("DEBUG: EXIT!")
# DEBUG: print("DEBUG: Updating last_nodeinfo for domain:", domain)
_set_data("last_nodeinfo", domain, time.time())
- _set_data("last_updated" , domain, time.time())
# Running pending updated
# DEBUG: print(f"DEBUG: Invoking update_data({domain}) ...")
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_peers,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return peers
try:
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_blocks,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return
try:
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_peers,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return peers
# iterating through all "suspended" (follow-only in its terminology)
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_blocks,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return blocklist
# iterating through all "suspended" (follow-only in its terminology)
headers = csrf.determine(domain, dict())
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during checking CSRF (fetch_peers,{__name__}) - EXIT!")
+ instances.set_last_error(domain, exception)
return peers
for mode in ["followers", "following"]:
rows = federation.fetch_nodeinfo(domain, nodeinfo_url)
except network.exceptions as exception:
print(f"WARNING: Exception '{type(exception)}' during fetching nodeinfo")
+ instances.set_last_error(domain, exception)
if rows is None:
print("WARNING: Could not fetch nodeinfo from domain:", domain)