]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 21 Apr 2025 00:43:03 +0000 (02:43 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 21 Apr 2025 00:43:03 +0000 (02:43 +0200)
- a `SELECT` on table `instances` doesn't need to be checked if the domain is
  registered (ops)

fba/commands.py

index 22eefbd2279e91da9ab6cd94f050eb8eb64c170d..0cc17776bd8c90ec6134f027f85fbf58ef493c9d 100644 (file)
@@ -1033,6 +1033,7 @@ def fetch_instances(args: argparse.Namespace) -> int:
 
         logger.debug("rows()=%d", len(rows))
         if len(rows) == 0:
+            logger.debug("Appending args.domain='%s' to empty rows list ...", args.domain)
             rows.append({
                 "domain"  : args.domain,
                 "origin"  : None,
@@ -1050,10 +1051,10 @@ def fetch_instances(args: argparse.Namespace) -> int:
     logger.info("Checking %d entries ...", len(rows))
     for row in rows:
         logger.debug("row[domain]='%s',row[origin]='%s',row[software]='%s'", row["domain"], row["origin"], row["software"])
-        if row["software"] is None and instances.is_registered(row["domain"]) :
+        if row["software"] is None:
             logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force-all to get it updated - SKIPPED!", row["domain"], row["domain"])
             continue
-        elif row["software"] is not None and software_helper.is_relay(row["software"]) and instances.is_registered(row["domain"]):
+        elif row["software"] is not None and software_helper.is_relay(row["software"]):
             logger.warning("row[domain]='%s' is of software type '%s' which is not supported by this command. Please invoke fetch_relays instead - SKIPPED!", row["domain"], row["software"])
             continue
         elif not args.force_all and not args.software in [None, ""] and instances.is_recent(row["domain"]):
@@ -1075,8 +1076,7 @@ def fetch_instances(args: argparse.Namespace) -> int:
         return 0
 
     # Loop through some instances
-    database.cursor.execute(
-        "SELECT domain, origin, software \
+    database.cursor.execute("SELECT domain, origin, software \
 FROM instances \
 WHERE software IN ( \
     'pleroma'   , 'mastodon', 'friendica' , 'misskey'  , 'lemmy'      , \