Browse Source

Use `TimeSpan.FromSeconds(5)` instead of zero.

pull/14842/head
maliming 4 years ago
parent
commit
b1eef4dcbd
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
  2. 4
      framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.cs

4
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs

@ -18,8 +18,8 @@ public class AbpAspNetCoreMvcClientModule : AbpModule
{
Configure<AbpAspNetCoreMvcClientCacheOptions>(options =>
{
options.TenantConfigurationCacheAbsoluteExpiration = TimeSpan.Zero;
options.ApplicationConfigurationDtoCacheAbsoluteExpiration = TimeSpan.Zero;
options.TenantConfigurationCacheAbsoluteExpiration = TimeSpan.FromSeconds(5);
options.ApplicationConfigurationDtoCacheAbsoluteExpiration = TimeSpan.FromSeconds(5);
});
}
}

4
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)
});
}

Loading…
Cancel
Save