forked from ddrilling/AsbCloudServer
fix TelemetryAnalyticsService.AnalyzeAndSaveTelemetriesAsync().
This commit is contained in:
parent
f4f4974cdd
commit
809ee137aa
@ -231,13 +231,9 @@ namespace AsbCloudInfrastructure.Services.Analysis
|
|||||||
|
|
||||||
public async Task AnalyzeAndSaveTelemetriesAsync(CancellationToken token = default)
|
public async Task AnalyzeAndSaveTelemetriesAsync(CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var allTelemetryIds = await db.TelemetryDataSaub
|
var allTelemetryIds = await db.Telemetries.Select(t => t.Id).ToListAsync(token).ConfigureAwait(false);
|
||||||
.Select(t => t.IdTelemetry)
|
|
||||||
.Distinct()
|
|
||||||
.ToListAsync(token)
|
|
||||||
.ConfigureAwait(false);
|
|
||||||
|
|
||||||
foreach(var idTelemetry in allTelemetryIds)
|
foreach (var idTelemetry in allTelemetryIds)
|
||||||
{
|
{
|
||||||
var analyzeStartDate = await GetLastAnalysisDateAsync(idTelemetry, token).ConfigureAwait(false);
|
var analyzeStartDate = await GetLastAnalysisDateAsync(idTelemetry, token).ConfigureAwait(false);
|
||||||
await AnalyseAndSaveTelemetryAsync(idTelemetry, analyzeStartDate, token).ConfigureAwait(false);
|
await AnalyseAndSaveTelemetryAsync(idTelemetry, analyzeStartDate, token).ConfigureAwait(false);
|
||||||
|
@ -7,6 +7,7 @@ namespace AsbCloudWebApi
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
//new TraceListenerView(); // to trace mysterious errors
|
||||||
CreateHostBuilder(args).Build().Run();
|
CreateHostBuilder(args).Build().Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
31
AsbCloudWebApi/TraceListenerView.cs
Normal file
31
AsbCloudWebApi/TraceListenerView.cs
Normal file
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"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",
|
"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",
|
"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"
|
"LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"
|
||||||
|
Loading…
Reference in New Issue
Block a user