From 364c1d9273fb0d3cd83e97cbaa1771c77561b076 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 14 Jul 2018 13:45:06 +0200 Subject: [PATCH] More logging --- activitypub.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activitypub.py b/activitypub.py index 6ce6483..7391733 100644 --- a/activitypub.py +++ b/activitypub.py @@ -170,6 +170,7 @@ class MicroblogPubBackend(Backend): return data["activity"] # Fetch the URL via HTTP + logger.info(f"dereference {iri} via HTTP") return super().fetch_iri(iri) def fetch_iri(self, iri: str) -> ap.ObjectType: @@ -177,14 +178,17 @@ class MicroblogPubBackend(Backend): return ME if iri in ACTORS_CACHE: + logger.info(f"{iri} found in cache") return ACTORS_CACHE[iri] data = DB.actors.find_one({"remote_id": iri}) if data: + logger.info(f"{iri} found in DB cache") ACTORS_CACHE[iri] = data["data"] return data["data"] data = self._fetch_iri(iri) + logger.debug(f"_fetch_iri({iri!r}) == {data!r}") if ap._has_type(data["type"], ap.ACTOR_TYPES): # Cache the actor DB.actors.update_one(