mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
More logging
This commit is contained in:
parent
a9379a5205
commit
364c1d9273
1 changed files with 4 additions and 0 deletions
|
@ -170,6 +170,7 @@ class MicroblogPubBackend(Backend):
|
||||||
return data["activity"]
|
return data["activity"]
|
||||||
|
|
||||||
# Fetch the URL via HTTP
|
# Fetch the URL via HTTP
|
||||||
|
logger.info(f"dereference {iri} via HTTP")
|
||||||
return super().fetch_iri(iri)
|
return super().fetch_iri(iri)
|
||||||
|
|
||||||
def fetch_iri(self, iri: str) -> ap.ObjectType:
|
def fetch_iri(self, iri: str) -> ap.ObjectType:
|
||||||
|
@ -177,14 +178,17 @@ class MicroblogPubBackend(Backend):
|
||||||
return ME
|
return ME
|
||||||
|
|
||||||
if iri in ACTORS_CACHE:
|
if iri in ACTORS_CACHE:
|
||||||
|
logger.info(f"{iri} found in cache")
|
||||||
return ACTORS_CACHE[iri]
|
return ACTORS_CACHE[iri]
|
||||||
|
|
||||||
data = DB.actors.find_one({"remote_id": iri})
|
data = DB.actors.find_one({"remote_id": iri})
|
||||||
if data:
|
if data:
|
||||||
|
logger.info(f"{iri} found in DB cache")
|
||||||
ACTORS_CACHE[iri] = data["data"]
|
ACTORS_CACHE[iri] = data["data"]
|
||||||
return data["data"]
|
return data["data"]
|
||||||
|
|
||||||
data = self._fetch_iri(iri)
|
data = self._fetch_iri(iri)
|
||||||
|
logger.debug(f"_fetch_iri({iri!r}) == {data!r}")
|
||||||
if ap._has_type(data["type"], ap.ACTOR_TYPES):
|
if ap._has_type(data["type"], ap.ACTOR_TYPES):
|
||||||
# Cache the actor
|
# Cache the actor
|
||||||
DB.actors.update_one(
|
DB.actors.update_one(
|
||||||
|
|
Loading…
Reference in a new issue