forked from gongxuegit/tiku-backend.net
perf: optimize authorization scoreline and workers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user