fix bug
This commit is contained in:
@ -31,7 +31,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
|
||||
self.eventmanager = EventManager()
|
||||
|
||||
@staticmethod
|
||||
def __load_cache(filename: str) -> Any:
|
||||
def load_cache(filename: str) -> Any:
|
||||
"""
|
||||
从本地加载缓存
|
||||
"""
|
||||
@ -41,7 +41,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def __save_cache(cache: Any, filename: str) -> None:
|
||||
def save_cache(cache: Any, filename: str) -> None:
|
||||
"""
|
||||
保存缓存到本地
|
||||
"""
|
||||
|
@ -59,7 +59,7 @@ class MessageChain(ChainBase):
|
||||
logger.debug(f'未识别到消息内容::{body}{form}{args}')
|
||||
return
|
||||
# 加载缓存
|
||||
user_cache: Dict[str, dict] = self.__load_cache(self._cache_file) or {}
|
||||
user_cache: Dict[str, dict] = self.load_cache(self._cache_file) or {}
|
||||
# 处理消息
|
||||
logger.info(f'收到用户消息内容,用户:{userid},内容:{text}')
|
||||
if text.startswith('/'):
|
||||
@ -311,7 +311,7 @@ class MessageChain(ChainBase):
|
||||
items=medias[:self._page_size],
|
||||
userid=userid, total=len(medias))
|
||||
# 保存缓存
|
||||
self.__save_cache(user_cache, self._cache_file)
|
||||
self.save_cache(user_cache, self._cache_file)
|
||||
|
||||
def __post_medias_message(self, channel: MessageChannel,
|
||||
title: str, items: list, userid: str, total: int):
|
||||
|
@ -297,7 +297,7 @@ class SubscribeChain(ChainBase):
|
||||
刷新站点最新资源
|
||||
"""
|
||||
# 读取缓存
|
||||
torrents_cache: Dict[str, List[Context]] = self.__load_cache(self._cache_file) or {}
|
||||
torrents_cache: Dict[str, List[Context]] = self.load_cache(self._cache_file) or {}
|
||||
|
||||
# 所有站点索引
|
||||
indexers = self.siteshelper.get_indexers()
|
||||
@ -363,7 +363,7 @@ class SubscribeChain(ChainBase):
|
||||
# 从缓存中匹配订阅
|
||||
self.__match(torrents_cache)
|
||||
# 保存缓存到本地
|
||||
self.__save_cache(torrents_cache, self._cache_file)
|
||||
self.save_cache(torrents_cache, self._cache_file)
|
||||
|
||||
def __match(self, torrents_cache: Dict[str, List[Context]]):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user