MCPcopy Index your code
hub / github.com/dataease/SQLBot / wrapper

Function wrapper

backend/common/core/sqlbot_cache.py:72–87  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

70
71 @wraps(func)
72 async def wrapper(*args, **kwargs):
73 if not settings.CACHE_TYPE or settings.CACHE_TYPE.lower() == "none" or not is_cache_initialized():
74 return await func(*args, **kwargs)
75 # 生成缓存键
76 cache_key = used_key_builder(
77 func=func,
78 namespace=str(namespace) if namespace else "",
79 args=args,
80 kwargs=kwargs
81 )
82
83 return await original_cache(
84 expire=expire,
85 namespace=str(namespace) if namespace else "",
86 key_builder=lambda *_, **__: cache_key
87 )(func)(*args, **kwargs)
88
89 return wrapper
90 return decorator

Callers

nothing calls this directly

Calls 5

is_cache_initializedFunction · 0.85
custom_key_builderFunction · 0.85
getMethod · 0.65
deleteMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected