perf: optimize authorization scoreline and workers

This commit is contained in:
2026-07-30 09:12:27 +08:00
parent 4bea745b79
commit bedc77bffd
52 changed files with 21911 additions and 347 deletions

View File

@@ -13,7 +13,8 @@ namespace Tiku.Infrastructure.Tenancy;
public sealed class TenantFrontendConfigService(
TikuDbContext dbContext,
IMemoryCache cache,
IFeatureAccessService featureAccessService) : ITenantFrontendConfigService
IFeatureAccessService featureAccessService,
ITenantPublicCacheInvalidator publicCacheInvalidator) : ITenantFrontendConfigService
{
private static readonly TimeSpan RuntimeCacheDuration = TimeSpan.FromMinutes(2);
@@ -77,6 +78,7 @@ public sealed class TenantFrontendConfigService(
config.PublishedAt = DateTimeOffset.UtcNow;
await dbContext.SaveChangesAsync(cancellationToken);
cache.Remove(CacheKey(tenantId));
await publicCacheInvalidator.InvalidateAsync(tenantId, cancellationToken);
return ToItem(config);
}