feat(t104): 多帳號同時看守——切換概念消滅
leo 架構依據:「它只是一個門,幾個帳號通過它同步並沒有影響」+ 「我不是 Google Drive……不提供暫存空間,daemon 工作輕巧,多帳號只是頁簽問題」 (D-daemon-not-Drive)。 Accounts[] 每帳號獨立連線+資料夾;舊 config 冪等遷移 accounts[0]; 逐帳號同步一敗不擋全;status.json 分帳;托盤每帳號一分組; 「連上知識庫」→「+新增帳號…」(append 非替換);t86 切換清空退役; t101 刪除作用於正確帳號。+873/-149、collector 5+tray 5 新測試, 兩模組 go test 全綠(總管親跑)。 (實作=子 CC;驗證+commit=總管)
This commit is contained in:
+18
-6
@@ -8,18 +8,30 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// AccountSyncStatus 彙總單一帳號的每輪同步結果(t104 多帳號看守)。
|
||||
// key in SyncStatus.AccountDetails = instanceHostOf(cypher_url)。
|
||||
type AccountSyncStatus struct {
|
||||
LastSync string `json:"last_sync,omitempty"`
|
||||
CloudVersion string `json:"cloud_version,omitempty"` // t103 per-account
|
||||
CloudCheckOK bool `json:"cloud_check_ok"`
|
||||
ExtractedOK int `json:"extracted_ok"`
|
||||
ExtractFailed int `json:"extract_failed"`
|
||||
}
|
||||
|
||||
// SyncStatus 彙總每輪同步的萃取結果,持久化至 ~/.arcrun-rag/status.json。
|
||||
// 托盤依此決定顯示「已萃 N 檔」、「⚠ 萃取失敗 M 檔」還是「⚠ 萃取引擎未就緒」。
|
||||
type SyncStatus struct {
|
||||
LastSync string `json:"last_sync,omitempty"` // RFC3339,最近一輪完成時間
|
||||
ExtractedOK int `json:"extracted_ok"` // 本輪萃取成功件數(跨資料夾累計)
|
||||
ExtractFailed int `json:"extract_failed"` // 本輪萃取失敗件數
|
||||
ExtractedOK int `json:"extracted_ok"` // 本輪萃取成功件數(跨帳號累計)
|
||||
ExtractFailed int `json:"extract_failed"` // 本輪萃取失敗件數(跨帳號)
|
||||
Failures []ExtractFail `json:"failures,omitempty"` // 失敗清單(路徑+白話原因)
|
||||
ExtractorOK bool `json:"extractor_ok"` // 萃取器本身是否就緒(預檢)
|
||||
ExtractorOK bool `json:"extractor_ok"` // 萃取器本身是否就緒(預檢,機器層級)
|
||||
ExtractorError string `json:"extractor_error,omitempty"` // 未就緒的白話原因
|
||||
// t103:雲端版本偵測(每輪 GET /health)
|
||||
CloudVersion string `json:"cloud_version,omitempty"` // bundle_version 回傳值(空=老實例)
|
||||
CloudCheckOK bool `json:"cloud_check_ok"` // /health 可達才為 true;false 代表網路失敗,不判定過舊
|
||||
// 頂層 cloud 欄位保留向後相容(單帳號時同時填頂層+AccountDetails)
|
||||
CloudVersion string `json:"cloud_version,omitempty"` // bundle_version(單帳號時填)
|
||||
CloudCheckOK bool `json:"cloud_check_ok"` // /health 可達才為 true
|
||||
// t104:per-account 狀態(key = instanceHostOf(cypher_url))
|
||||
AccountDetails map[string]AccountSyncStatus `json:"account_details,omitempty"`
|
||||
}
|
||||
|
||||
// ExtractFail 記一筆萃取失敗(路徑+白話原因)。
|
||||
|
||||
Reference in New Issue
Block a user