Files
ewoooc/migrations/011_embedding_retry_queue.sql
ogt 1b4f3a7bbe
Some checks failed
CD Pipeline / deploy (push) Failing after 59s
feat: EwoooC 初始化 — 完整專案推版至 Gitea
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 01:21:13 +08:00

22 lines
1.0 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ADR-007 Step 4: embedding 失敗持久化 retry queue
-- 日期: 2026-04-19
-- 原因: 原本 openclaw_learning_service._embedding_queue 為記憶體 Queue
-- Python 進程重啟會遺失未處理項目。改為 DB 表 + Hermes worker 輪詢。
CREATE TABLE IF NOT EXISTS embedding_retry_queue (
id SERIAL PRIMARY KEY,
target_table VARCHAR(50) NOT NULL, -- 'ai_insights' / 'conversations'
target_id INTEGER NOT NULL, -- 目標列 id
text_content TEXT NOT NULL, -- 要 embed 的原文
model VARCHAR(50) DEFAULT 'bge-m3:latest',
status VARCHAR(20) DEFAULT 'pending', -- pending / processing / done / failed
attempts INTEGER DEFAULT 0,
last_error TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
processed_at TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_embed_retry_status ON embedding_retry_queue(status, created_at);
CREATE INDEX IF NOT EXISTS idx_embed_retry_target ON embedding_retry_queue(target_table, target_id);