From 42f7e02a7faf9903d50dc8206fda43007d7b0606 Mon Sep 17 00:00:00 2001 From: taywon Date: Sun, 19 May 2024 18:07:26 +0200 Subject: [PATCH] removed software monitoring --- Salmon.Core/Depth/StateMachine.cs | 10 ++++++++-- Salmon.Web/Program.cs | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Salmon.Core/Depth/StateMachine.cs b/Salmon.Core/Depth/StateMachine.cs index c98a440..3008cc5 100644 --- a/Salmon.Core/Depth/StateMachine.cs +++ b/Salmon.Core/Depth/StateMachine.cs @@ -23,12 +23,18 @@ public class StateMachine Dictionary> Implementation = new (); public bool Populated { get; private set; } = false; - public async Task PopulateWithHistory() + public async Task 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) diff --git a/Salmon.Web/Program.cs b/Salmon.Web/Program.cs index 8dd87fa..be37c5d 100644 --- a/Salmon.Web/Program.cs +++ b/Salmon.Web/Program.cs @@ -33,10 +33,9 @@ builder.Services.AddSingleton(); 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();