From fbbc720cbce63138eeef186db44718ce4e517133 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 24 Aug 2023 18:59:38 +0200 Subject: [PATCH] Continued: - also order this list by total peers first, then row id --- fba/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fba/commands.py b/fba/commands.py index 86e601c..a682df2 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -951,7 +951,7 @@ def fetch_instances(args: argparse.Namespace) -> int: # Loop through some instances database.cursor.execute( - "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus', 'neodb') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY rowid DESC", [time.time() - config.get("recheck_instance")] + "SELECT domain, origin, software, nodeinfo_url FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'lemmy', 'peertube', 'takahe', 'gotosocial', 'brighteon', 'wildebeest', 'bookwyrm', 'mitra', 'areionskey', 'mammuthus', 'neodb') AND (last_instance_fetch IS NULL OR last_instance_fetch < ?) ORDER BY total_peers DESC, rowid DESC", [time.time() - config.get("recheck_instance")] ) rows = database.cursor.fetchall() -- 2.39.5