MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / run

Function run

apps/common/utils/cache_util.py:39–50  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

37def get_cache(cache_key, use_get_data: any = True, cache_instance=cache, version=None):
38 def inner(get_data):
39 def run(*args, **kwargs):
40 key = cache_key(*args, **kwargs) if callable(cache_key) else cache_key
41 is_use_get_data = use_get_data(*args, **kwargs) if callable(use_get_data) else use_get_data
42 if is_use_get_data:
43 if cache_instance.has_key(key, version=version):
44 return cache_instance.get(key, version=version)
45 data = get_data(*args, **kwargs)
46 cache_instance.add(key, data, timeout=None, version=version)
47 return data
48 data = get_data(*args, **kwargs)
49 cache_instance.set(key, data, timeout=None, version=version)
50 return data
51
52 return run
53

Callers

nothing calls this directly

Calls 4

getMethod · 0.45
addMethod · 0.45
setMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected