diff --git a/AsbCloudInfrastructure/Services/Analysis/TelemetryAnalyticsService.cs b/AsbCloudInfrastructure/Services/Analysis/TelemetryAnalyticsService.cs index 42d60940..c2c6381a 100644 --- a/AsbCloudInfrastructure/Services/Analysis/TelemetryAnalyticsService.cs +++ b/AsbCloudInfrastructure/Services/Analysis/TelemetryAnalyticsService.cs @@ -231,13 +231,9 @@ namespace AsbCloudInfrastructure.Services.Analysis public async Task AnalyzeAndSaveTelemetriesAsync(CancellationToken token = default) { - var allTelemetryIds = await db.TelemetryDataSaub - .Select(t => t.IdTelemetry) - .Distinct() - .ToListAsync(token) - .ConfigureAwait(false); + var allTelemetryIds = await db.Telemetries.Select(t => t.Id).ToListAsync(token).ConfigureAwait(false); - foreach(var idTelemetry in allTelemetryIds) + foreach (var idTelemetry in allTelemetryIds) { var analyzeStartDate = await GetLastAnalysisDateAsync(idTelemetry, token).ConfigureAwait(false); await AnalyseAndSaveTelemetryAsync(idTelemetry, analyzeStartDate, token).ConfigureAwait(false); diff --git a/AsbCloudWebApi/Program.cs b/AsbCloudWebApi/Program.cs index d4106a2e..73cd343f 100644 --- a/AsbCloudWebApi/Program.cs +++ b/AsbCloudWebApi/Program.cs @@ -7,6 +7,7 @@ namespace AsbCloudWebApi { public static void Main(string[] args) { + //new TraceListenerView(); // to trace mysterious errors CreateHostBuilder(args).Build().Run(); } diff --git a/AsbCloudWebApi/TraceListenerView.cs b/AsbCloudWebApi/TraceListenerView.cs new file mode 100644 index 00000000..3d45c690 --- /dev/null +++ b/AsbCloudWebApi/TraceListenerView.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; + +namespace AsbCloudWebApi +{ + public class TraceListenerView : TraceListener + { + public TraceListenerView() + { + Trace.Listeners.Add(this); + } + + public override void Write(object o) + { + base.Write(o); + } + + public override void Write(string message) + { + //throw new NotImplementedException(); + } + + public override void WriteLine(string message) + { + //throw new NotImplementedException(); + } + } +} diff --git a/AsbCloudWebApi/appsettings.json b/AsbCloudWebApi/appsettings.json index 55675a79..234b99e3 100644 --- a/AsbCloudWebApi/appsettings.json +++ b/AsbCloudWebApi/appsettings.json @@ -7,7 +7,7 @@ } }, "ConnectionStrings": { - "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True", + "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", "DebugConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True", "ServerConnection": "Host=192.168.1.70;Database=postgres;Username=postgres;Password=q;Persist Security Info=True", "LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"