使用 LRUcache 清除缓存工具的缓存

问题描述

我有功能

from cachetools import cached
from cachetools import LRUCache

@cached(cache=LRUCache(maxsize=256),key=lambda system,bus_map,get_hint=False,more_info=False: (hash_dict(bus_map),get_hint,more_info))
def calc_wait_time(system: System,bus_map: Dict[int,List[Tuple[int,int]]],get_hint: bool = False,more_info: bool = False):

(其中 System 是 Class I defiend 并且 hash_dict 转换为frozenset)

我尝试使用 calc_wait_time.cache_clear() 但它说 'function' object has no attribute 'cache_clear'

我也试过 calc_wait_time.clear() 但它不起作用

我做错了什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)