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

Method get_multi

openlibrary/core/cache.py:322–327  ·  view source on GitHub ↗
(self, keys: list[str])

Source from the content-addressed store, hash-verified

320 return value and json.loads(value)
321
322 def get_multi(self, keys: list[str]) -> dict[str, Any]:
323 keys = [self._encode_key(k) for k in keys]
324 stats.begin("memcache.get_multi")
325 d = self.memcache.get_multi(keys)
326 stats.end(hit=bool(d))
327 return {k: json.loads(v) for k, v in d.items()}
328
329 def set_multi(self, mapping: dict[str, Any], expires=0):
330 mapping = {self._encode_key(k): json.dumps(v) for k, v in mapping.items()}

Callers 1

get_availability_asyncFunction · 0.45

Calls 3

_encode_keyMethod · 0.95
loadsMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected