removed software monitoring

This commit is contained in:
taywon 2024-05-19 18:07:26 +02:00
parent 01af7a3e36
commit 42f7e02a7f
2 changed files with 10 additions and 5 deletions

View File

@ -23,12 +23,18 @@ public class StateMachine
Dictionary<string, Dictionary<string, ImplValue>> Implementation = new ();
public bool Populated { get; private set; } = false;
public async Task PopulateWithHistory()
public async Task<long> PopulateWithHistory()
{
Populated = true;
long count = 0;
if (History is not null)
await foreach (var i in History.GetState())
Push(i);
{
Push(i);
count++;
}
return count;
}
public void Push(Triplet triplet)

View File

@ -33,10 +33,9 @@ builder.Services.AddSingleton<WeatherForecastService>();
Console.WriteLine("Connected to Mongo database.");
CoreInstance.Persistence = dbInterface;
CoreInstance.State.History = dbInterface;
await CoreInstance.State.PopulateWithHistory();
Console.WriteLine($"Populated with {CoreInstance.State.CountTriplets()} triplets");
long count = await CoreInstance.State.PopulateWithHistory();
Console.WriteLine($"Populated with {count} triplets");
builder.Services.AddSingleton(dbInterface);
builder.Services.AddSingleton(new CurrentSoftwareRefresher(CoreInstance));
var app = builder.Build();