Sql server 分布式sql server缓存中的执行超时是否已过期?
“执行超时已过期。操作完成前超时时间已过,或者服务器未响应。”在分布式sql server缓存中 我调用控制器的方法 我的问题:-Sql server 分布式sql server缓存中的执行超时是否已过期?,sql-server,asp.net-core,model-view-controller,distributed-caching,executiontimeout,Sql Server,Asp.net Core,Model View Controller,Distributed Caching,Executiontimeout,“执行超时已过期。操作完成前超时时间已过,或者服务器未响应。”在分布式sql server缓存中 我调用控制器的方法 我的问题:- {“执行超时已过期。操作完成前超时时间已过,或者服务器未响应。”}在分布式sql server缓存中 当debug点击行时,等待distributedCache.SetStringAsync(KeyHere,Value,options)。记录超过3000行 如果我遗漏了什么,请帮忙。或者需要添加到代码中。提前感谢您的支持和关注。您可以查看 public asy
- {“执行超时已过期。操作完成前超时时间已过,或者服务器未响应。”}在分布式sql server缓存中
public async Task<IEnumerable<NormalDeposit_DepositDetails>> GetAllNormalDeposit_DepositDetails_Async()
{
if (IsCacheEnable == true)
{
IEnumerable<NormalDeposit_DepositDetails> NormalDeposit_DepositDetails_AllList;
var KeyHere = KeyCache.GenCacheKey(CacheKeyList.NormalDeposit_DepositDetails_CacheSecurityKeyString, SecurityKey);
var GetCachehere = await distributedCache.GetStringAsync(KeyHere);
if (string.IsNullOrEmpty(GetCachehere))
{
context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
NormalDeposit_DepositDetails_AllList = await context.NormalDeposit_DepositDetails.AsNoTracking().ToListAsync();
DistributedCacheEntryOptions options = new DistributedCacheEntryOptions();
options.AbsoluteExpiration = DateTime.Now.AddHours(12);
options.SlidingExpiration = TimeSpan.FromMinutes(30);
var Value = JsonConvert.SerializeObject(NormalDeposit_DepositDetails_AllList);
await distributedCache.SetStringAsync(KeyHere, Value, options);
return NormalDeposit_DepositDetails_AllList;
}
else
{
return JsonConvert.DeserializeObject<IEnumerable<NormalDeposit_DepositDetails>>(GetCachehere);
}
}
else
{
IEnumerable<NormalDeposit_DepositDetails> NormalDeposit_DepositDetails_AllList;
context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
NormalDeposit_DepositDetails_AllList = await context.NormalDeposit_DepositDetails.AsNoTracking().ToListAsync();
return NormalDeposit_DepositDetails_AllList;
}
}
[AllowAnonymous]
[HttpPost]
public async Task<IActionResult> GetDataHere()
{
var ItemsHere = await normalDeposit_DepositDetailsInterface.GetAllNormalDeposit_DepositDetails_Async();
decimal NormalDeposit_Deposit_AfterDeposit = ItemsHere.Where(a => a.Status == true ).Sum(s => s.Amount);
return View("Index");
}
"ConnectionStrings": {
"ConnectionVar": "Server=DESKTOP-IACJQY;Database=$aZ1*,z.ahbz.@!78z)c;User Id=*&zkaUI190%$User{]z!Z,a;password=+1z)9.,!aEL%ZKI9@$MnaL><f;Trusted_Connection=False;MultipleActiveResultSets=true;Connection Timeout=1800;"
}
services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = _config.GetConnectionString("ConnectionVar");
options.SchemaName = "dbo";
options.TableName = "SQLSessions";
options.DefaultSlidingExpiration = TimeSpan.FromMinutes(30);
options.ExpiredItemsDeletionInterval = TimeSpan.FromMinutes(30);
});