MCPcopy Index your code
hub / github.com/pyload/pyload / cached

Function cached

module/lib/beaker/cache.py:100–114  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

98 def decorate(func):
99 namespace = util.func_namespace(func)
100 def cached(*args):
101 reg = cache_regions[region]
102 if not reg.get('enabled', True):
103 return func(*args)
104
105 if not cache[0]:
106 if region not in cache_regions:
107 raise BeakerException('Cache region not configured: %s' % region)
108 cache[0] = Cache._get_cache(namespace, reg)
109
110 cache_key = " ".join(map(str, deco_args + args))
111 def go():
112 return func(*args)
113
114 return cache[0].get_value(cache_key, createfunc=go)
115 cached._arg_namespace = namespace
116 cached._arg_region = region
117 return cached

Callers

nothing calls this directly

Calls 5

BeakerExceptionClass · 0.90
_get_cacheMethod · 0.80
joinMethod · 0.80
get_valueMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected