Browse Source

Set `CacheAbsoluteExpiration ` to 60 seconds.

pull/18064/head
maliming 3 years ago
parent
commit
7a52c95434
  1. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteDynamicClaimsPrincipalContributorCacheOptions.cs
  2. 4
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserUpdatedEventHandler.cs

2
framework/src/Volo.Abp.AspNetCore.Mvc.Client.Common/Volo/Abp/AspNetCore/Mvc/Client/RemoteDynamicClaimsPrincipalContributorCacheOptions.cs

@ -8,6 +8,6 @@ public class RemoteDynamicClaimsPrincipalContributorCacheOptions
public RemoteDynamicClaimsPrincipalContributorCacheOptions()
{
CacheAbsoluteExpiration = TimeSpan.FromSeconds(5);
CacheAbsoluteExpiration = TimeSpan.FromSeconds(60);
}
}

4
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserUpdatedEventHandler.cs

@ -14,14 +14,11 @@ public class UserEntityUpdatedEventHandler :
ILocalEventHandler<EntityDeletedEventData<IdentityUser>>,
ITransientDependency
{
public ILogger<UserEntityUpdatedEventHandler> Logger { get; set; }
private readonly IdentityDynamicClaimsPrincipalContributorCache _cache;
public UserEntityUpdatedEventHandler(IdentityDynamicClaimsPrincipalContributorCache cache)
{
_cache = cache;
Logger = NullLogger<UserEntityUpdatedEventHandler>.Instance;
}
[UnitOfWork]
@ -38,7 +35,6 @@ public class UserEntityUpdatedEventHandler :
protected virtual async Task ClearAsync(Guid userId, Guid? tenantId)
{
Logger.LogDebug($"Clearing dynamic claims cache for user: {userId}");
await _cache.ClearAsync(userId, tenantId);
}
}

Loading…
Cancel
Save