forked from ddrilling/AsbCloudServer
Fix TelemetryDataCache<TDto>.InitializeCacheFromDBAsync
This commit is contained in:
parent
26f01eb236
commit
8d17a88f3d
@ -163,15 +163,16 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
||||
private async Task InitializeCacheFromDBAsync<TEntity>(IAsbCloudDbContext db, Action<string, double?> onProgress, CancellationToken token)
|
||||
where TEntity : class, AsbCloudDb.Model.ITelemetryData
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isLoading)
|
||||
throw new Exception("Multiple cache loading detected.");
|
||||
var defaultTimeout = db.Database.GetCommandTimeout();
|
||||
db.Database.SetCommandTimeout(TimeSpan.FromMinutes(5));
|
||||
|
||||
if (isLoading)
|
||||
throw new Exception("Multiple cache loading detected.");
|
||||
|
||||
try
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
db.Database.SetCommandTimeout(TimeSpan.FromMinutes(5));
|
||||
|
||||
Well[] wells = await db.Set<Well>()
|
||||
.Include(well => well.Telemetry)
|
||||
.Include(well => well.Cluster)
|
||||
@ -198,7 +199,6 @@ namespace AsbCloudInfrastructure.Services.SAUB
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
var defaultTimeout = db.Database.GetCommandTimeout();
|
||||
db.Database.SetCommandTimeout(defaultTimeout);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user