解决异步查询时,异常
This commit is contained in:
@@ -321,8 +321,8 @@ public class DbLinkService : IDbLinkService, IDynamicApiController, ITransient
|
|||||||
var model = await _memCache.GetOrCreateAsync($"DbLink_{id}", async entry =>
|
var model = await _memCache.GetOrCreateAsync($"DbLink_{id}", async entry =>
|
||||||
{
|
{
|
||||||
//entry.AbsoluteExpiration = DateTime.Now.AddMinutes(60);
|
//entry.AbsoluteExpiration = DateTime.Now.AddMinutes(60);
|
||||||
entry.SlidingExpiration = TimeSpan.FromSeconds(60);
|
//entry.SlidingExpiration = TimeSpan.FromSeconds(-1);
|
||||||
return await _repository.GetFirstAsync(m => m.Id == id && m.DeleteMark == null);
|
return await _repository.AsSugarClient().CopyNew().Queryable<DbLinkEntity>().FirstAsync(m => m.Id == id && m.DeleteMark == null);
|
||||||
});
|
});
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user