perf: User delete api

This commit is contained in:
fit2cloud-chenyw
2025-07-15 17:30:43 +08:00
parent a817cfcdc9
commit 0c91240d11
4 changed files with 54 additions and 7 deletions
+2 -2
View File
@@ -168,9 +168,9 @@ def clear_cache(
)
logger.debug(f"Clearing cache for key: {cache_key}")
# 2. 清除缓存
await FastAPICache.clear(key=cache_key)
if await FastAPICache.get_backend().get(cache_key):
await FastAPICache.clear(key=cache_key)
# 3. 执行原函数
return await func(*args, **kwargs)