feat(t98): 托盤「立刻同步」——訊號檔法零 IPC,跨平台

leo:「無法知道到底同步了沒,可以在 daemon 上加一個立刻同步?」
tray 點擊寫 ~/.arcrun-rag/sync-now+短暫顯示「同步中…」;collector 主迴圈 1 秒輪詢
訊號檔、有就立刻跑一輪刪檔,無則照 PollSec 排程;完成後 status.json 更新自然刷新托盤。
測試:collector+supervisor+tray 三模組全綠(總管親跑)。
(實作=子 CC;驗證+commit=總管)
This commit is contained in:
2026-07-28 15:06:08 +08:00
parent 903ca60154
commit 77aa4c5195
6 changed files with 202 additions and 6 deletions
+6
View File
@@ -49,3 +49,9 @@ func LoadSyncStatus(path string) (SyncStatus, error) {
err = json.Unmarshal(data, &s)
return s, err
}
// SyncNowSignalPath 回傳立刻同步訊號檔路徑:與 manifest 同目錄的 sync-now。
// tray 寫入此檔 → collector 偵測到後立刻跑一輪同步並刪除它。
func SyncNowSignalPath(manifestPath string) string {
return filepath.Join(filepath.Dir(manifestPath), "sync-now")
}