From c9cd9a8337b3ad22fbfae32bc770a8e0fa662264 Mon Sep 17 00:00:00 2001 From: kaniini Date: Tue, 20 Nov 2018 01:10:43 +0000 Subject: [PATCH] actor: handle remote actor fetch failures more gracefully --- relay/actor.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/relay/actor.py b/relay/actor.py index ce46857..15c136b 100644 --- a/relay/actor.py +++ b/relay/actor.py @@ -105,9 +105,12 @@ async def push_message_to_actor(actor, message, our_key_id): async def follow_remote_actor(actor_uri): - logging.info('following: %r', actor_uri) - actor = await fetch_actor(actor_uri) + if not actor: + logging.info('failed to fetch actor at: %r', actor_uri) + return + + logging.info('following: %r', actor_uri) message = { "@context": "https://www.w3.org/ns/activitystreams", @@ -121,9 +124,12 @@ async def follow_remote_actor(actor_uri): async def unfollow_remote_actor(actor_uri): - logging.info('unfollowing: %r', actor_uri) - actor = await fetch_actor(actor_uri) + if not actor: + logging.info('failed to fetch actor at: %r', actor_uri) + return + + logging.info('unfollowing: %r', actor_uri) message = { "@context": "https://www.w3.org/ns/activitystreams",