stabilizaiton work - projects rework for maintenanceability and ui livening

This commit is contained in:
master
2026-02-03 23:40:04 +02:00
parent 074ce117ba
commit 557feefdc3
3305 changed files with 186813 additions and 107843 deletions

View File

@@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore;
using System.Globalization;
namespace StellaOps.Provcache.Postgres;
public sealed partial class PostgresProvcacheRepository
{
/// <inheritdoc />
public async Task<long> DeleteByFeedEpochOlderThanAsync(string feedEpoch, CancellationToken cancellationToken = default)
{
var deleted = await _context.ProvcacheItems
.Where(e => string.Compare(e.FeedEpoch, feedEpoch) < 0)
.ExecuteDeleteAsync(cancellationToken)
.ConfigureAwait(false);
if (deleted > 0)
{
await LogRevocationAsync("feed", feedEpoch, "feed-update", deleted, cancellationToken)
.ConfigureAwait(false);
}
return deleted;
}
/// <inheritdoc />
public async Task<long> DeleteExpiredAsync(DateTimeOffset asOf, CancellationToken cancellationToken = default)
{
var deleted = await _context.ProvcacheItems
.Where(e => e.ExpiresAt <= asOf)
.ExecuteDeleteAsync(cancellationToken)
.ConfigureAwait(false);
if (deleted > 0)
{
await LogRevocationAsync(
"expired",
asOf.ToString("O", CultureInfo.InvariantCulture),
"ttl-expiry",
deleted,
cancellationToken)
.ConfigureAwait(false);
}
return deleted;
}
}