Browse Source

Merge pull request #22844 from abpframework/auto-merge/rel-9-1/3716

Merge branch rel-9.2 with rel-9.1
pull/22845/head
maliming 1 year ago
committed by GitHub
parent
commit
4cd1c4084d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs

14
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDynamicClaimsPrincipalContributorCache.cs

@ -58,9 +58,9 @@ public class IdentityDynamicClaimsPrincipalContributorCache : ITransientDependen
return emptyCacheItem; return emptyCacheItem;
} }
return await DynamicClaimCache.GetOrAddAsync(AbpDynamicClaimCacheItem.CalculateCacheKey(userId, tenantId), async () => using (CurrentTenant.Change(tenantId))
{ {
using (CurrentTenant.Change(tenantId)) return await DynamicClaimCache.GetOrAddAsync(AbpDynamicClaimCacheItem.CalculateCacheKey(userId, tenantId), async () =>
{ {
Logger.LogDebug($"Filling dynamic claims cache for user: {userId}"); Logger.LogDebug($"Filling dynamic claims cache for user: {userId}");
@ -82,11 +82,11 @@ public class IdentityDynamicClaimsPrincipalContributorCache : ITransientDependen
} }
return dynamicClaims; return dynamicClaims;
} }, () => new DistributedCacheEntryOptions
}, () => new DistributedCacheEntryOptions {
{ AbsoluteExpirationRelativeToNow = CacheOptions.Value.CacheAbsoluteExpiration
AbsoluteExpirationRelativeToNow = CacheOptions.Value.CacheAbsoluteExpiration });
}); }
} }
public virtual async Task ClearAsync(Guid userId, Guid? tenantId = null) public virtual async Task ClearAsync(Guid userId, Guid? tenantId = null)

Loading…
Cancel
Save