From c843f967b83ca0edafc86843b21351044f1d1e4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 25 Jun 2023 18:41:05 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20if=20peers=C2=A0list=20is=20emp?= =?utf8?q?ty,=20try=20to=20fetch=20from=20/instances?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- fba/networks/lemmy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index f589664..37cf8cc 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -70,8 +70,9 @@ def fetch_peers(domain: str, origin: str) -> list: logger.debug("Marking domain='%s' as successfully handled ...") instances.set_success(domain) - else: - logger.warning("JSON response does not contain 'federated_instances', domain='%s' - trying /instances ...", domain) + + if len(peers) == 0: + logger.warning("Fetching instances for domain='%s' from /instances ...", domain) peers = fetch_instances(domain, origin) except network.exceptions as exception: -- 2.39.5