mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
test1
This commit is contained in:
parent
f672ef47eb
commit
cd9c18291e
@ -582,13 +582,16 @@ class CacheManager:
|
||||
if _name in self._data:
|
||||
raise DbCacheException(f"缓存 {name} 已存在")
|
||||
|
||||
self._data[_name] = CacheData(
|
||||
# 先创建 CacheData 实例(不传入 _cache)
|
||||
cache_data = CacheData(
|
||||
name=_name,
|
||||
func=func,
|
||||
expire=expire,
|
||||
lazy_load=lazy_load,
|
||||
_cache=self._cache,
|
||||
)
|
||||
# 然后手动设置 _cache 属性
|
||||
cache_data._cache = self._cache
|
||||
self._data[_name] = cache_data
|
||||
return func
|
||||
|
||||
return wrapper
|
||||
|
||||
Loading…
Reference in New Issue
Block a user