From 756ecc88b2d2d44f65732db186330196287fc820 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 25 Jun 2023 07:28:14 +0200 Subject: [PATCH] Continued: - exclude instances with no nodeinfo URL --- fba/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index 0430ca9..f19d51b 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -214,12 +214,12 @@ def fetch_blocks(args: argparse.Namespace) -> int: # Re-check single software logger.debug("Querying database for args.software='%s' ...", args.software) database.cursor.execute( - "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software = ?", [args.software] + "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software = ? AND nodeinfo_url IS NOT NULL", [args.software] ) else: # Re-check after "timeout" (aka. minimum interval) database.cursor.execute( - "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_block")] + "SELECT domain, software, origin, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'lemmy', 'friendica', 'misskey', 'peertube') AND (last_blocked IS NULL OR last_blocked < ?) AND nodeinfo_url IS NOT NULL ORDER BY rowid DESC", [time.time() - config.get("recheck_block")] ) rows = database.cursor.fetchall() -- 2.39.5