removed software monitoring
This commit is contained in:
parent
01af7a3e36
commit
42f7e02a7f
@ -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);
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public void Push(Triplet triplet)
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user