feat: record sync runs

This commit is contained in:
Vincent Koc 2026-04-26 23:28:33 -07:00
parent bf3013019c
commit f730e69cb2
No known key found for this signature in database

View File

@ -99,6 +99,17 @@ func (s *Syncer) Sync(ctx context.Context, options Options) (Stats, error) {
}
}
stats.FinishedAt = s.now().Format(time.RFC3339Nano)
if _, err := s.store.RecordRun(ctx, store.RunRecord{
RepoID: repoID,
Kind: "sync",
Scope: "open",
Status: "success",
StartedAt: stats.StartedAt,
FinishedAt: stats.FinishedAt,
StatsJSON: mustJSON(stats),
}); err != nil {
return Stats{}, err
}
return stats, nil
}