fields.append(nodeinfos[key][domain])
sql_string += f" {key} = ?,"
- sql_string = sql_string[:-1]
fields.append(domain)
# NOISY-DEBUG: print(f"DEBUG: sql_string='{sql_string}',fields()={len(fields)}")
- sql = "UPDATE instances SET" + sql_string + " WHERE domain = ? LIMIT 1"
+ sql = "UPDATE instances SET" + sql_string + " last_status_code = NULL, last_error_details = NULL WHERE domain = ? LIMIT 1"
# NOISY-DEBUG: print("DEBUG: sql:", sql)
try:
if domain in nodeinfos["nodeinfo_url"]:
# NOISY-DEBUG # NOISY-DEBUG: print("DEBUG: domain has pending nodeinfo being updated:", domain)
update_nodeinfos(domain)
-
- if domain in pending_errors:
+ try:
+ # Prevent updating any pending errors, nodeinfo was found
+ del pending_errors[domain]
+ except:
+ pass
+ elif domain in pending_errors:
# NOISY-DEBUG: print("DEBUG: domain has pending error being updated:", domain)
update_last_error(domain, pending_errors[domain])
del pending_errors[domain]
print(f"INFO: Checking {len(peerlist)} instances from {domain} ...")
for instance in peerlist:
- instance = instance.lower()
+ # NOISY-DEBUG: print("DEBUG: BEFORE instance:", instance)
+ instance = fba.tidyup(instance)
+ # NOISY-DEBUG: print("DEBUG: AFTER instance:", instance)
- if not validators.domain(instance):
+ if instance == "":
+ print("WARNING: Empty instance after tidyup(), domain:", domain)
+ continue
+ elif not validators.domain(instance):
print("WARNING: Bad instance name,domain:", instance, domain)
continue
elif fba.is_blacklisted(instance):