MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / memcache

Method memcache

openlibrary/core/cache.py:303–310  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

301
302 @functools.cached_property
303 def memcache(self):
304 if servers := config.get("memcache_servers", None):
305 return olmemcache.Client(servers)
306 else:
307 web.debug("Could not find memcache_servers in the configuration. Used dummy memcache.")
308 from pymemcache.test.utils import MockMemcacheClient
309
310 return MockMemcacheClient()
311
312 def _encode_key(self, key: str) -> str:
313 return cast(str, web.safestr(key))

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected