mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 12:50:03 +08:00
✨ 修复一些bug
- 移除不必要的定时器类,简化代码结构 - 优化好友请求处理逻辑,确保在自动同意和手动处理之间的清晰区分 - 更新缓存机制,避免重复处理相同的好友请求 - 新增判断文件是否为二进制文件的功能,提升文件处理的准确性 - 优化缓存字典的过期检查逻辑,提高性能和可读性
This commit is contained in:
+1
-6
@@ -82,12 +82,7 @@ class CacheDict(Generic[T]):
|
||||
return False
|
||||
|
||||
# 检查是否过期
|
||||
data = self._data[key]
|
||||
if data.expire_time > 0 and data.expire_time < time.time():
|
||||
del self._data[key]
|
||||
return False
|
||||
|
||||
return True
|
||||
return bool(self.expire_time(key))
|
||||
|
||||
def get(self, key: str, default: Any = None) -> T | None:
|
||||
"""获取字典项,如果不存在返回默认值
|
||||
|
||||
Reference in New Issue
Block a user