ws: record daily repo stats history alongside current upsert

This commit is contained in:
2026-05-07 18:46:26 +01:00
parent b9c7ec6ebf
commit bb2a88be24
2 changed files with 43 additions and 0 deletions
+4
View File
@@ -339,6 +339,10 @@ func dispatchAgentMessage(ctx context.Context, c *Conn, hostID string, env api.E
} else {
slog.Info("ws: repo stats refreshed", "host_id", hostID)
}
day := time.Now().UTC().Format("2006-01-02")
if err := deps.Store.UpsertHostRepoStatsHistory(ctx, hostID, day, patch, time.Now().UTC()); err != nil {
slog.Warn("ws: upsert host repo stats history", "host_id", hostID, "err", err)
}
case api.MsgCommandResult:
// TODO(P2): persist command.result acks for "did the agent