From b1eef4dcbd4299d6e4c2a2d31ef6fd6a399e256a Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 8 Dec 2022 16:20:07 +0800 Subject: [PATCH] Use `TimeSpan.FromSeconds(5)` instead of zero. --- .../Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs | 4 ++-- .../Abp/IdentityModel/IdentityModelAuthenticationService.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs index 4a7e8b6cb4..610a41eefd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs @@ -18,8 +18,8 @@ public class AbpAspNetCoreMvcClientModule : AbpModule { Configure(options => { - options.TenantConfigurationCacheAbsoluteExpiration = TimeSpan.Zero; - options.ApplicationConfigurationDtoCacheAbsoluteExpiration = TimeSpan.Zero; + options.TenantConfigurationCacheAbsoluteExpiration = TimeSpan.FromSeconds(5); + options.ApplicationConfigurationDtoCacheAbsoluteExpiration = TimeSpan.FromSeconds(5); }); } } diff --git a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs index a900dc3d03..32952a7050 100644 --- a/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs +++ b/framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs @@ -103,7 +103,7 @@ public class IdentityModelAuthenticationService : IIdentityModelAuthenticationSe await TokenCache.SetAsync(cacheKey, tokenCacheItem, new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = AbpHostEnvironment.IsDevelopment() - ? TimeSpan.Zero + ? TimeSpan.FromSeconds(5) : TimeSpan.FromSeconds(configuration.CacheAbsoluteExpiration) }); } @@ -151,7 +151,7 @@ public class IdentityModelAuthenticationService : IIdentityModelAuthenticationSe new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = AbpHostEnvironment.IsDevelopment() - ? TimeSpan.Zero + ? TimeSpan.FromSeconds(5) : TimeSpan.FromSeconds(configuration.CacheAbsoluteExpiration) }); }