19 lines
544 B
C#
19 lines
544 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace StellaOps.Provcache;
|
|
|
|
public sealed partial class ProvcacheService
|
|
{
|
|
/// <inheritdoc />
|
|
public async Task<long> PruneExpiredAsync(CancellationToken cancellationToken = default)
|
|
{
|
|
var pruned = await _repository.DeleteExpiredAsync(_timeProvider.GetUtcNow(), cancellationToken)
|
|
.ConfigureAwait(false);
|
|
|
|
_logger.LogInformation("Pruned {Count} expired cache entries", pruned);
|
|
return pruned;
|
|
}
|
|
}
|