forked from xiongyuxing/tiku-backend.net
15 lines
580 B
C#
15 lines
580 B
C#
using Microsoft.AspNetCore.OutputCaching;
|
|
using Tiku.Application.Tenancy;
|
|
|
|
namespace Tiku.Api.Caching;
|
|
|
|
internal sealed class TenantPublicCacheInvalidator(IOutputCacheStore outputCacheStore)
|
|
: ITenantPublicCacheInvalidator
|
|
{
|
|
public ValueTask InvalidateCoreAsync(Guid tenantId, CancellationToken cancellationToken) =>
|
|
outputCacheStore.EvictByTagAsync($"tenant:{tenantId:N}", cancellationToken);
|
|
|
|
public async Task InvalidateAsync(Guid tenantId, CancellationToken cancellationToken = default) =>
|
|
await InvalidateCoreAsync(tenantId, cancellationToken);
|
|
}
|