mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14: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"]
|
||||
|
||||
# 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(
|
||||
|
|
Loading…
Reference in a new issue