Disable actor caching in the DB for debug

This commit is contained in:
Thomas Sileo 2018-07-16 22:41:17 +02:00
parent f44f9992c9
commit 854f48495e

View file

@ -181,15 +181,17 @@ class MicroblogPubBackend(Backend):
logger.info(f"{iri} found in 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") # if ap._has_type(data["type"], ap.ACTOR_TYPES):
ACTORS_CACHE[iri] = data["data"] # logger.info(f"{iri} found in DB cache")
return data["data"] # ACTORS_CACHE[iri] = data["data"]
# return data["data"]
data = self._fetch_iri(iri) data = self._fetch_iri(iri)
logger.debug(f"_fetch_iri({iri!r}) == {data!r}") 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):
logger.debug(f"caching actor {iri}")
# Cache the actor # Cache the actor
DB.actors.update_one( DB.actors.update_one(
{"remote_id": iri}, {"remote_id": iri},