print("ERROR: Cannot fetch peers:", domain)
return
- fba.c.execute(
+ fba.cursor.execute(
"SELECT domain FROM instances WHERE domain = ? LIMIT 1", [domain]
)
- if fba.c.fetchone() == None:
+ if fba.cursor.fetchone() == None:
# NOISY-DEBUG: print("DEBUG: Adding new domain:", domain, origin)
fba.add_instance(domain, origin, sys.argv[0])
# NOISY-DEBUG: print("DEBUG: Handling instance:", instance)
try:
- fba.c.execute(
+ fba.cursor.execute(
"SELECT domain FROM instances WHERE domain = ? LIMIT 1", [instance]
)
- if fba.c.fetchone() == None:
+ if fba.cursor.fetchone() == None:
# NOISY-DEBUG: print("DEBUG: Adding new instance:", instance, domain)
fba.add_instance(instance, domain, sys.argv[0])
- fba.conn.commit()
+ fba.connection.commit()
except Exception as e:
print("ERROR:", e, instance)
fetch_instances(instance, None)
# Loop through some instances
-fba.c.execute(
- "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (software IS NULL OR last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
+fba.cursor.execute(
+ "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
)
-for instance in fba.c.fetchall():
+for instance in fba.cursor.fetchall():
if fba.is_blacklisted(instance[0]):
# NOISY-DEBUG: print("DEBUG: domain is blacklisted:", instance)
continue
print("INFO: Fetching instances for instance:", instance[0])
fetch_instances(instance[0], None)
-fba.conn.close()
+fba.connection.close()