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

Method set

openlibrary/core/cache.py:336–342  ·  view source on GitHub ↗
(self, key: str, value: Any, expires=0)

Source from the content-addressed store, hash-verified

334 return d
335
336 def set(self, key: str, value: Any, expires=0):
337 key = cast(str, web.safestr(key))
338 value = json.dumps(value)
339 stats.begin("memcache.set", key=key)
340 value = self.memcache.set(key, value, expires)
341 stats.end()
342 return value
343
344 def add(self, key, value, expires=0):
345 key = web.safestr(key)

Callers

nothing calls this directly

Calls 2

dumpsMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected