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
+9
View File
@@ -149,6 +149,15 @@ func TestStatusFilePath(t *testing.T) {
}
}
// TestSyncNowSignalPath:依 manifest 路徑回傳同目錄 sync-nowt98)。
func TestSyncNowSignalPath(t *testing.T) {
got := SyncNowSignalPath("/home/leo/.arcrun-rag/manifest.json")
want := "/home/leo/.arcrun-rag/sync-now"
if got != want {
t.Errorf("SyncNowSignalPath=%q want=%q", got, want)
}
}
// ── RunDirectOnce 寫狀態檔(t91 整合)────────────────────────────────────────
// TestRunDirectOnceWritesStatusRunDirectOnce 完成後應在 manifest 同目錄寫出 status.json。