Browse Source
Use `TimeSpan.FromSeconds(5)` instead of zero.
pull/14842/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
4 additions and
4 deletions
-
framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs
-
framework/src/Volo.Abp.IdentityModel/Volo/Abp/IdentityModel/IdentityModelAuthenticationService.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); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -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) |
|
|
|
}); |
|
|
|
} |
|
|
|
|