From 8b78f2f76a64f05c11a7e2a52798a06e86ac6677 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 22 Aug 2023 20:34:24 +0200 Subject: [PATCH] Continued: - added parameter --no-software which fetching instances with no software detected and not recently being checked - the parameter --force is not re-checking recently entries. If you want this you need to use ./nodeinfo.sh --software --force but be kind to other webmasters! --- fba/boot.py | 1 + fba/commands.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/fba/boot.py b/fba/boot.py index 6c14c2a..c25466f 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -207,6 +207,7 @@ def init_parser(): parser.add_argument("--domain", help="Instance name (aka. domain)") parser.add_argument("--software", help="Name of software, e.g. 'lemmy'") parser.add_argument("--force", action="store_true", help="Forces update of data, no matter what.") + parser.add_argument("--no-software", action="store_true", help="Checks only entries with no software type detected.") ### Fetch instances from instances.social ### parser = subparser_command.add_parser( diff --git a/fba/commands.py b/fba/commands.py index b021cab..eb3fe20 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1721,6 +1721,9 @@ def update_nodeinfo(args: argparse.Namespace) -> int: elif args.software is not None and args.software != "": logger.info("Fetching domains for args.software='%s'", args.software) database.cursor.execute("SELECT domain, software FROM instances WHERE software = ?", [args.software]) + elif args.no_software: + logger.info("Fetching domains with no software type detected ...") + database.cursor.execute("SELECT domain, software FROM instances WHERE software IS NULL AND (last_nodeinfo < ? OR last_nodeinfo IS NULL)", [time.time() - config.get("recheck_nodeinfo")]) else: logger.info("Fetching domains for recently updated ...") database.cursor.execute("SELECT domain, software FROM instances WHERE last_nodeinfo < ? OR last_nodeinfo IS NULL", [time.time() - config.get("recheck_nodeinfo")]) -- 2.39.2