+ blacklisted = False
+ for domain in fba.blacklist:
+ if domain in instance:
+ blacklisted = True
+
+ if blacklisted:
+ # NOISY-DEBUG: print("DEBUG: domain is blacklisted:", domain)
+ continue
+
+ # NOISY-DEBUG: print("DEBUG: Handling instance:", instance)
+ try:
+ fba.c.execute(
+ "SELECT domain FROM instances WHERE domain = ? LIMIT 1", (instance,)
+ )
+
+ if fba.c.fetchone() == None:
+ # NOISY-DEBUG: print("DEBUG: Adding new instance:", instance)
+ fba.add_instance(instance)
+
+ fba.conn.commit()
+
+ except Exception as e:
+ print("ERROR:", e, instance)
+ continue
+
+instance = sys.argv[1]
+
+# Initial fetch
+fetch_instances(instance)
+
+# Loop through some instances