feat(kpi): GetLatestRollupHourAsync watermark seam for the backfill fast-path (plan R2-04 T2)
This commit is contained in:
@@ -192,6 +192,15 @@ public sealed class KpiHistoryRepository : IKpiHistoryRepository
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<DateTime?> GetLatestRollupHourAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
// Single MAX over the unique IX_KpiRollupHourly_Series population (the rollup
|
||||
// table is small — one row per series-hour). Null when no rollups exist.
|
||||
return await _context.KpiRollupHourly
|
||||
.MaxAsync(r => (DateTime?)r.HourStartUtc, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task PurgeRollupsOlderThanAsync(DateTime before, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user