fix(ai): 遷移 Ollama embedding 至 api embed
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s

This commit is contained in:
OoO
2026-04-30 10:24:15 +08:00
parent 7f695928c3
commit 72fa166729
11 changed files with 114 additions and 14 deletions

View File

@@ -101,3 +101,8 @@
- **原因**: Flask routes 會頻繁建立 `DatabaseManager()`,若每次都產生新 engine/poolGunicorn 多 worker 會快速吃滿 PostgreSQL clients。
- **修復**: `DatabaseManager``(DATABASE_TYPE, DATABASE_PATH)` 重用 engine/session且 PostgreSQL pool 收斂為 `pool_size=2/max_overflow=3`
- **檢查**: app log 應出現 `使用 PostgreSQL 資料庫 (連線池已收斂)`Gunicorn `post_fork` 仍需 dispose inherited engines。
### 10. OpenClaw embedding timeout
- **原因**: Hermes/Ollama 負載高或舊 `/api/embeddings` endpoint 慢,會讓 embedding worker 累加 retry。
- **檢查**: 看 `embedding_retry_queue``pending/processing/failed` 分布,並測 `http://192.168.0.111:11434/api/embed`
- **修復**: client 預設使用官方 `/api/embed`;若舊節點 404/405 才 fallback `/api/embeddings`。必要時調整 `EMBEDDING_TIMEOUT`