Commit Graph

4 Commits

Author SHA1 Message Date
雅诺狐
e39c34f366 fix: 修复视频分析并发处理和数据库存储问题
🔧 修复视频分析模块的关键并发和存储问题

**主要修复:**
1. **并发竞争条件修复**
   - 解决相同视频hash同时处理导致重复分析的问题
   - 重构并发控制机制,使用per-video独立锁和事件
   - 消除30秒超时后多个请求同时执行的竞争条件

2. **数据库存储优化**
   - 移除Videos表path字段的复杂唯一性检查逻辑
   - 简化为基于hash的纯唯一标识存储
   - 修复path字段重复导致的IntegrityError

3. **代码简化和清理**
   - 删除重编码视频检测功能(复杂且用处有限)
   - 移除不必要的特征匹配和计数更新逻辑
   - 简化存储路径生成,统一使用hash前缀

Fixes: 视频并发处理竞争条件、数据库存储冲突、聊天循环变量错误
2025-11-19 22:46:11 +08:00
minecraft1024a
a31ee1ab5f refactor(video): update config key from utils_video to video_analysis 2025-11-19 22:44:56 +08:00
雅诺狐
bb4592846c Refactor config system to use Pydantic validation
Refactored configuration classes to inherit from a new ValidatedConfigBase using Pydantic for robust validation and error reporting. Updated api_ada_configs.py, config.py, config_base.py, and official_configs.py to replace dataclasses with Pydantic models, add field validation, and improve error messages. This change enhances configuration reliability and developer feedback for misconfigurations. Also includes minor code cleanups and removal of unused variables in other modules.
2025-11-19 22:44:45 +08:00
雅诺狐
2e6ae2419b 优化项目结构,格式化代码 2025-11-19 22:35:40 +08:00