]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 21 May 2023 09:56:32 +0000 (11:56 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 21 May 2023 10:00:30 +0000 (12:00 +0200)
- make all software names lower-case
- also include initial instance

fba.py
fetch_instances.py

diff --git a/fba.py b/fba.py
index c4e23b205f8140f4803634a659251d0f0e199ea8..0d467b05cb6363ff92168c5ae07d90af253e91c6 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -167,7 +167,7 @@ def determine_software(domain: str) -> str:
             software = "misskey"
         else:
             # NOISY-DEBUG: print("DEBUG: Using name:", domain, json["software"]["name"])
-            software = json["software"]["name"]
+            software = json["software"]["name"].lower()
 
     except:
         print("WARNING: Could not determine software type:", domain)
index 8a4a45c8ee33a256759a89f0252a0294f32f4917..3a2733847c570b859eb129f586296067098d2a86 100644 (file)
@@ -10,18 +10,17 @@ def fetch_instances(domain: str, origin: str):
 
     if (peerlist is None):
         print("ERROR: Cannot fetch peers:", domain)
+        return
 
-        fba.c.execute(
-            "SELECT domain FROM instances WHERE domain = ? LIMIT 1", [domain]
-        )
-
-        if fba.c.fetchone() == None:
-            # NOISY-DEBUG: print("DEBUG: Adding new domain:", domain, origin)
-            fba.add_instance(domain, origin, sys.argv[0])
+    fba.c.execute(
+        "SELECT domain FROM instances WHERE domain = ? LIMIT 1", [domain]
+    )
 
-        fba.conn.commit()
-        return
+    if fba.c.fetchone() == None:
+        # NOISY-DEBUG: print("DEBUG: Adding new domain:", domain, origin)
+        fba.add_instance(domain, origin, sys.argv[0])
 
+    print(f"INFO: Checking {len(peerlist)} instances from {domain} ...")
     for instance in peerlist:
         instance = instance.lower()
         if instance.find("@") > 0: