forked from ddrilling/AsbCloudServer
ignoring strange issue.
This commit is contained in:
parent
81e765581c
commit
187c83a7b1
@ -13,7 +13,6 @@ namespace AsbCloudInfrastructure.Services.Cache
|
||||
private (DateTime refreshDate, IEnumerable<object> entities) data;
|
||||
private readonly List<TEntity> cached;
|
||||
private readonly DbSet<TEntity> dbSet;
|
||||
private readonly SemaphoreSlim semaphore = new SemaphoreSlim(1, 1);
|
||||
|
||||
internal CacheTable(DbContext context, (DateTime refreshDate, IEnumerable<object> entities) data)
|
||||
{
|
||||
@ -29,8 +28,16 @@ namespace AsbCloudInfrastructure.Services.Cache
|
||||
{
|
||||
if (cached.Any())
|
||||
{
|
||||
semaphore.Wait();
|
||||
cached.Clear();
|
||||
try
|
||||
{
|
||||
cached.Clear();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
// TODO: figure out what the well
|
||||
}
|
||||
|
||||
}
|
||||
var dbEntities = context.Set<TEntity>().AsNoTracking().ToList();
|
||||
cached.AddRange(dbEntities);
|
||||
@ -42,8 +49,15 @@ namespace AsbCloudInfrastructure.Services.Cache
|
||||
{
|
||||
if (cached.Any())
|
||||
{
|
||||
await semaphore.WaitAsync(token).ConfigureAwait(true);
|
||||
cached.Clear();
|
||||
try
|
||||
{
|
||||
cached.Clear();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
// TODO: figure out what the well
|
||||
}
|
||||
}
|
||||
var dbEntities = await context.Set<TEntity>().AsNoTracking().ToListAsync(token).ConfigureAwait(false);
|
||||
cached.AddRange(dbEntities);
|
||||
|
Loading…
Reference in New Issue
Block a user