]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 2 Jun 2024 14:53:24 +0000 (16:53 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 2 Jun 2024 14:53:24 +0000 (16:53 +0200)
- show run-mode of nodeinfo.sh
- fetch_instances can now (again) fetch new instances (not registered)

fba/commands.py
nodeinfo.sh

index 59c97f145b033a07bb17faa487832710a7ca4380..eed28133583799c7329c25a89b359c56965f94c5 100644 (file)
@@ -277,7 +277,7 @@ def fetch_blocks(args: argparse.Namespace) -> int:
             logger.warning("args.domain='%s' is blacklisted, won't check it!", args.domain)
             return 101
         elif not instances.is_registered(args.domain):
-            logger.warning("args.domain='%s' is not registered, please run ./utils.py fetch_instances '%s' first.", args.domain, args.domain)
+            logger.warning("args.domain='%s' is not registered, please run ./fba.py fetch_instances --domain=%s first.", args.domain, args.domain)
             return 102
 
     logger.debug("Invoking locking.acquire() ...")
@@ -984,6 +984,13 @@ def fetch_instances(args: argparse.Namespace) -> int:
         # Fetch record
         database.cursor.execute("SELECT domain, origin, software FROM instances WHERE domain = ? LIMIT 1", [domain])
         rows = database.cursor.fetchall()
+
+        if len(rows) == 0:
+            rows.append({
+                "domain"  : args.domain,
+                "origin"  : None,
+                "software": None,
+            })
     elif args.software not in [None, ""]:
         logger.debug("args.software='%s' - BEFORE!", args.software)
         software = software_helper.alias(args.software)
@@ -999,7 +1006,7 @@ def fetch_instances(args: argparse.Namespace) -> int:
         if row["software"] is None and instances.is_registered(row["domain"]) :
             logger.warning("row[domain]='%s' has no software detected. You can try to run ./fba.py update_nodeinfo --domain=%s --force to get it updated - SKIPPED!", row["domain"], row["domain"])
             continue
-        elif 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"]) and instances.is_registered(row["domain"]):
             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 and not args.software in [None, ""]and instances.is_recent(row["domain"]):
index 2ba294481e231ca6fe31c07c70c89837883072df..adfc385f66389a14776b77366ccdb8c44a4fcd2e 100755 (executable)
@@ -30,6 +30,7 @@ then
        MODE="generator"
 else
        DOMAIN_LIST=$(sqlite3 blocks.db "SELECT domain FROM instances WHERE software IS NULL AND nodeinfo_url IS NOT NULL ORDER BY last_updated ASC;")
+       MODE="nodeinfo_null"
 fi
 
 if [ -z "${DOMAIN_LIST}" -a -z "${SOFTWARE_LIST}" ]
@@ -38,6 +39,8 @@ then
        exit 255
 fi
 
+echo "$0: Run-mode is: '${MODE}'"
+
 if [ -n "${DOMAIN_LIST}" ]
 then
        for DOMAIN in ${DOMAIN_LIST};