diff --git a/docs/SERVICES.md b/docs/SERVICES.md index 0b5a555..b69c5c2 100644 --- a/docs/SERVICES.md +++ b/docs/SERVICES.md @@ -4,8 +4,8 @@ |------|------| | 建立者 | Warren | | 建立時間 | 2026-03-18 | -| 更新時間 | 2026-03-24 | -| 文件版本 | V1.1 | +| 更新時間 | 2026-03-25 | +| 文件版本 | V1.2 | --- @@ -15,6 +15,7 @@ |------|------|------|--------|-----------| | V1.0 | 2026-03-18 | 創建文件 | Warren | OpenCode / MiniMax M2.5 | | V1.1 | 2026-03-24 | 更新所有服務 plist 狀態,統一使用自定義 plist | OpenCode | OpenCode / big-pickle | +| V1.2 | 2026-03-25 | 新增 Momentry Playground、Job Worker 說明 | OpenCode | OpenCode / GLM-5 | --- @@ -51,11 +52,54 @@ | MongoDB | 自定義 plist | 文件資料庫 | ✅ 正常 | | Qdrant | 自定義 plist | 向量資料庫 | ✅ 正常 | | Momentry API | 自定義 plist | 影片管理 API | ✅ 正常 | +| Momentry Playground | CLI | 開發測試用二進位 | ✅ 正常 | | RustDesk HBBR | 自定義 plist | 遠端桌面橋接 | ✅ 正常 | | RustDesk HBBS | 自定義 plist | 遠端桌面服務器 | ✅ 正常 | --- +## Momentry 服務說明 + +### Momentry API vs Momentry Playground + +| 項目 | Momentry API | Momentry Playground | +|------|--------------|---------------------| +| 用途 | 生產環境 | 開發/測試環境 | +| Port | 3002 | 3003 | +| Redis Prefix | `momentry:` | `momentry_dev:` | +| 環境變數 | `.env` | `.env.development` | +| 啟動命令 | `cargo run --bin momentry -- server` | `cargo run --bin momentry_playground -- server` | + +### Job Worker + +Job Worker 是 Momentry Core 的背景處理系統,負責執行影片處理任務。 + +**架構**: +- 輪詢 `monitor_jobs` 表取得待處理任務 +- 最多同時執行 2 個 processor(可透過環境變數調整) +- 更新 `processor_results` 表記錄每個處理器狀態 + +**環境變數**: +| 變數 | 預設值 | 說明 | +|------|--------|------| +| `MOMENTRY_MAX_CONCURRENT` | 2 | 最大並行處理器數 | +| `MOMENTRY_POLL_INTERVAL` | 5 | 輪詢間隔(秒) | +| `MOMENTRY_WORKER_ENABLED` | true | 是否啟用 Worker | + +**狀態監控**: +```bash +# 查看待處理工作 +psql -U accusys -d momentry -c "SELECT * FROM monitor_jobs WHERE status = 'pending';" + +# 查看執行中工作 +psql -U accusys -d momentry -c "SELECT * FROM monitor_jobs WHERE status = 'running';" + +# 查看處理器狀態 +psql -U accusys -d momentry -c "SELECT * FROM processor_results WHERE job_id = ;" +``` + +--- + ## 服務健康檢查結果 (2026-03-24) ### ✅ 正常運行的服務 @@ -69,6 +113,7 @@ | **n8n** | 2.12.3 | 5678/5681/5682 | `curl -s http://localhost:5678/healthz` | ✅ {"status":"ok"} | | **n8n Worker** | 2.12.3 | 5681/5690/5691 | - | ✅ 運行中 | | **Momentry API** | 0.1.0 | 3002 | `curl -s http://localhost:3002/health` | ✅ OK | +| **Momentry Playground** | 0.1.0 | 3003 | `curl -s http://localhost:3003/health` | ✅ OK (開發環境) | | **Qdrant** | 1.17.0 | 6333 | `curl -s http://localhost:6333/` | ✅ 版本資訊 | | **Caddy** | 2.10.x | 443 | `curl -sI https://momentry.ddns.net` | ✅ HTTP 200 | | **SFTPGo** | 2.7.x | 8080 | `curl -s http://localhost:8080/sftpgo/` | ✅ JSON 響應 |