diff --git a/api/funkwhale_api/federation/tasks.py b/api/funkwhale_api/federation/tasks.py index a0405f4a6..d46cd721c 100644 --- a/api/funkwhale_api/federation/tasks.py +++ b/api/funkwhale_api/federation/tasks.py @@ -633,7 +633,12 @@ def fetch_collection(url, max_pages, channel, is_page=False): def check_all_remote_instance_availability(): domains = models.Domain.objects.all().prefetch_related() for domain in domains: - check_single_remote_instance_availability(domain) + if domain == settings.FUNKWHALE_HOSTNAME: + # No need to check the instance itself: Its always reachable + domain.reachable = True + domain.last_successful_contact = timezone.now() + else: + check_single_remote_instance_availability(domain) @celery.app.task(name="federation.check_single_remote_instance_availability") diff --git a/api/funkwhale_api/music/models.py b/api/funkwhale_api/music/models.py index 8ce1fdcdd..9e4b81a15 100644 --- a/api/funkwhale_api/music/models.py +++ b/api/funkwhale_api/music/models.py @@ -1173,7 +1173,9 @@ class LibraryQuerySet(models.QuerySet): ) .values_list("target__channel__library", flat=True) ) - domains_reachable = federation_models.Domain.objects.filter(reachable=True) + domains_reachable = federation_models.Domain.objects.filter( + reachable=True + ) | federation_models.Domain.objects.filter(name=settings.FUNKWHALE_HOSTNAME) return self.filter( me_query