From 619267e6e86ce951d318bbf5b420b497a23d283d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 2 Jul 2023 09:24:45 +0200 Subject: [PATCH] Continued: - added parameter --all to include also already registered instances --- fba/boot.py | 1 + fba/commands.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/fba/boot.py b/fba/boot.py index 07b4a60..191321a 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -179,6 +179,7 @@ def init_parser(): ) parser.set_defaults(command=commands.fetch_fedilist) parser.add_argument("--software", help="Name of software, e.g. 'lemmy'") + parser.add_argument("--all", action="store_true", help="Include also already existing instances, otherwise only new are checked") logger.debug("EXIT!") diff --git a/fba/commands.py b/fba/commands.py index 7e36311..6e57c7e 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1314,6 +1314,9 @@ def fetch_fedilist(args: argparse.Namespace) -> int: elif not utils.is_domain_wanted(domain): logger.warning("domain='%s' is not wanted - SKIPPED!", domain) continue + elif args.all is None or not args.all and instances.is_registered(domain): + logger.debug("domain='%s' is already registered, --all not specified: args.all[]='%s'", type(args.all)) + continue elif instances.is_recent(domain): logger.debug("domain='%s' has been recently crawled - SKIPPED!", domain) continue -- 2.39.5