feat(server): 系统缓存清理接口与 OCR 文本层兜底增强
- 新增 system_cache 模块与 POST /settings/cache/clear,管理员可一键清理 OCR 结果/运行时配置/模型失败冷却/知识库索引/地点语义等进程内缓存 - 各服务暴露 clear_*_cache 方法(ocr/runtime_settings/runtime_chat/knowledge/application_location_semantic),SettingsCacheClearRead 汇总清理项 - OCR 转图片失败时尝试用 PDF 文本层兜底构建识别文档(有效字符≥8),并写结果缓存;OcrService 暴露 clear_result_cache - receipt_folder 车票过滤补充身份证号关键词,附件文档/操作/展示模块同步适配 - 新增 system_cache_endpoints 测试,更新 openapi_schema/ocr/receipt_folder/attachment_association_jobs 测试
This commit is contained in:
@@ -169,6 +169,12 @@ def _clear_settings_cache() -> None:
|
||||
_settings_cache_signature = None
|
||||
|
||||
|
||||
def clear_runtime_settings_cache() -> int:
|
||||
cleared_count = int(_settings_cache is not None)
|
||||
_clear_settings_cache()
|
||||
return cleared_count
|
||||
|
||||
|
||||
def get_settings() -> Settings:
|
||||
global _settings_cache, _settings_cache_signature
|
||||
|
||||
|
||||
Reference in New Issue
Block a user