Remote the object service, use the backend instead

This commit is contained in:
Thomas Sileo
2018-07-11 19:38:24 +02:00
parent 524a63235d
commit 01e165640e
3 changed files with 7 additions and 34 deletions

View File

@@ -1,21 +0,0 @@
import logging
from little_boxes.activitypub import get_backend
logger = logging.getLogger(__name__)
class ObjectService(object):
def __init__(self):
logger.debug("Initializing ObjectService")
self._cache = {}
def get(self, iri, reload_cache=False):
logger.info(f"get actor {iri} (reload_cache={reload_cache})")
if not reload_cache and iri in self._cache:
return self._cache[iri]
obj = get_backend().fetch_iri(iri)
self._cache[iri] = obj
return obj