mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 11:14:28 +00:00
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")
|
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},
|
||||||
|
|
Loading…
Reference in a new issue