From 57c6c765b60be94ac9d98ed5f7a9fe932823ce1e Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 5 Aug 2018 14:04:09 +0200 Subject: [PATCH] Tweak the tasks --- tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 0cf24e4..15c27a7 100644 --- a/tasks.py +++ b/tasks.py @@ -320,7 +320,10 @@ def finish_post_to_inbox(self, iri: str) -> None: try: activity = ap.fetch_remote_activity(iri) log.info(f"activity={activity!r}") + except (ActivityGoneError, ActivityNotFoundError): + log.exception(f"no retry") + try: if activity.has_type(ap.ActivityType.DELETE): back.inbox_delete(MY_PERSON, activity) elif activity.has_type(ap.ActivityType.UPDATE): @@ -343,7 +346,6 @@ def finish_post_to_inbox(self, iri: str) -> None: back.inbox_undo_announce(MY_PERSON, obj) elif obj.has_type(ap.ActivityType.FOLLOW): back.undo_new_follower(MY_PERSON, obj) - except Exception as err: log.exception(f"failed to cache attachments for {iri}") self.retry(exc=err, countdown=int(random.uniform(2, 4) ** self.request.retries)) @@ -368,7 +370,10 @@ def finish_post_to_outbox(self, iri: str) -> None: try: activity = ap.fetch_remote_activity(iri) log.info(f"activity={activity!r}") + except (ActivityGoneError, ActivityNotFoundError): + log.exception(f"no retry") + try: recipients = activity.recipients() if activity.has_type(ap.ActivityType.DELETE):