Merge branch 'dev' into fix/trajectory

This commit is contained in:
ngfrolov 2023-09-21 14:54:53 +05:00
commit cdf9ac80ea
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -157,9 +157,12 @@ namespace AsbCloudInfrastructure.Services.SAUB
throw new Exception("Multiple cache loading detected."); throw new Exception("Multiple cache loading detected.");
isLoading = true; isLoading = true;
Well[] wells = Array.Empty<Well>();
wells = await db.Set<Well>() var defaultTimeout = db.Database.GetCommandTimeout();
System.Diagnostics.Trace.TraceInformation($"cache loading starting. Setting CommandTimeout 90s ({defaultTimeout})");
db.Database.SetCommandTimeout(TimeSpan.FromSeconds(90));
Well[] wells = await db.Set<Well>()
.Include(well => well.Telemetry) .Include(well => well.Telemetry)
.Include(well => well.Cluster) .Include(well => well.Cluster)
.Where(well => well.IdTelemetry != null) .Where(well => well.IdTelemetry != null)
@ -188,6 +191,7 @@ namespace AsbCloudInfrastructure.Services.SAUB
System.Diagnostics.Trace.TraceInformation($"cache<{typeof(TDto).Name}> load complete"); System.Diagnostics.Trace.TraceInformation($"cache<{typeof(TDto).Name}> load complete");
isLoading = false; isLoading = false;
db.Database.SetCommandTimeout(defaultTimeout);
} }
private static async Task<TelemetryDataCacheItem?> GetOrDefaultCacheDataFromDbAsync<TEntity>(IAsbCloudDbContext db, int idTelemetry, int capacity, double hoursOffset, CancellationToken token) private static async Task<TelemetryDataCacheItem?> GetOrDefaultCacheDataFromDbAsync<TEntity>(IAsbCloudDbContext db, int idTelemetry, int capacity, double hoursOffset, CancellationToken token)