refactor: 清理代码质量和移除未使用文件
- 移除未使用的导入语句和变量 - 修复代码风格问题(空格、格式化等) - 删除备份文件和测试文件 - 改进异常处理链式调用 - 添加权限系统数据库模型和配置 - 更新版本号至6.4.4 - 优化SQL查询使用正确的布尔表达式
This commit is contained in:
@@ -214,7 +214,7 @@ class ActionDiagnostics:
|
||||
raise Exception("注册失败")
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(f"手动注册no_reply Action失败: {e}")
|
||||
raise Exception(f"手动注册no_reply Action失败: {e}") from e
|
||||
|
||||
def run_full_diagnosis(self) -> Dict[str, Any]:
|
||||
"""运行完整诊断"""
|
||||
|
||||
@@ -131,7 +131,7 @@ class AsyncMemoryQueue:
|
||||
await task.callback(None)
|
||||
else:
|
||||
task.callback(None)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
async def _handle_store_task(self, task: MemoryTask) -> Any:
|
||||
|
||||
@@ -271,7 +271,7 @@ class VectorInstantMemoryV2:
|
||||
return f"{int(diff/3600)}小时前"
|
||||
else:
|
||||
return f"{int(diff/86400)}天前"
|
||||
except:
|
||||
except Exception:
|
||||
return "时间格式错误"
|
||||
|
||||
async def get_memory_for_context(self, current_message: str, context_size: int = 3) -> str:
|
||||
@@ -318,7 +318,7 @@ class VectorInstantMemoryV2:
|
||||
try:
|
||||
result = self.collection.count()
|
||||
stats["total_messages"] = result
|
||||
except:
|
||||
except Exception:
|
||||
stats["total_messages"] = "查询失败"
|
||||
|
||||
return stats
|
||||
|
||||
Reference in New Issue
Block a user