Disable actor caching in the DB for debug
This commit is contained in:
parent
f44f9992c9
commit
854f48495e
1 changed files with 7 additions and 5 deletions
|
@ -181,15 +181,17 @@ class MicroblogPubBackend(Backend):
|
|||
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 = DB.actors.find_one({"remote_id": iri})
|
||||
# if data:
|
||||
# if ap._has_type(data["type"], ap.ACTOR_TYPES):
|
||||
# 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):
|
||||
logger.debug(f"caching actor {iri}")
|
||||
# Cache the actor
|
||||
DB.actors.update_one(
|
||||
{"remote_id": iri},
|
||||
|
|
Loading…
Reference in a new issue