feat: 停止信号优先 + DB环形缓冲区 (Task #1617 + #1618)

Task #1617 停止信号优先机制:
- 新增 threading.Event (_stop_event) 作为主停止信号
- 新增 _interruptible_sleep() 包装 Event.wait(timeout)
- 所有关键 time.sleep() 替换为 _interruptible_sleep()
- _poll 检查点同时检测 _stop_event.is_set() 和 _running
- stop()/_emergency_stop() 先 set() 唤醒阻塞线程
- start() 清除残留 stop_event

Task #1618 DB落库修复 + 环形缓冲区:
- user_messages/bot_messages 每平台最多10条 FIFO
- 物理重启时不清空这两张表(仅清空 ocr_staging/keyword_scores)
- 新增 SQLite 临时文件到 .gitignore

其他:
- 删除 _ocr_blue_test.py / _ocr_crop_test.py 调试文件
This commit is contained in:
youpaishidifu
2026-08-29 13:17:58 +08:00
parent 96388d18f9
commit c3f0fa0882
4 changed files with 148 additions and 117 deletions
+4
View File
@@ -73,3 +73,7 @@ _radical_*.txt
unicode_radicals.md.bak
easyocr_worker_state.json
easyocr_worker_state.json
# SQLite temp files
msg_history.db-shm
msg_history.db-wal