From 7fc85cdc233d090a721ad656eb1ec111ff8532ee Mon Sep 17 00:00:00 2001 From: Dustin Updyke Date: Tue, 2 Apr 2024 15:37:04 -0400 Subject: [PATCH] reduces queue logging --- .../Infrastructure/Services/QueueSyncService.cs | 17 ----------------- src/Ghosts.Api/ghosts.api.csproj | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/Ghosts.Api/Infrastructure/Services/QueueSyncService.cs b/src/Ghosts.Api/Infrastructure/Services/QueueSyncService.cs index 1c147fde..fb4fa62d 100755 --- a/src/Ghosts.Api/Infrastructure/Services/QueueSyncService.cs +++ b/src/Ghosts.Api/Infrastructure/Services/QueueSyncService.cs @@ -51,8 +51,6 @@ private async void Run() { while (true) { - _log.Trace("Beginning sync loop..."); - try { await Sync(); @@ -62,8 +60,6 @@ private async void Run() _log.Error(ex); } - _log.Trace("Ending sync loop"); - await Task.Delay(new TimeSpan(0, 0, Program.ApplicationSettings.QueueSyncDelayInSeconds)); } } @@ -111,8 +107,6 @@ private async Task ProcessNotification(ApplicationDbContext context, Notificatio try { - _log.Trace($"Attempting find for {item}"); - foreach (var webhook in webhooks) { var t = new Thread(() => { HandleWebhook(webhook, item); }) { IsBackground = true }; @@ -132,8 +126,6 @@ private async Task ProcessMachine(IServiceScope scope, ApplicationDbContext cont { var service = scope.ServiceProvider.GetRequiredService(); - _log.Trace("Scope and context created"); - var machines = new List(); var histories = new List(); var timelines = new List(); @@ -142,10 +134,6 @@ private async Task ProcessMachine(IServiceScope scope, ApplicationDbContext cont //clients can send up a "create webhook" payload var webhooks = new List(); - - _log.Trace("Beginning item processing..."); - - _log.Trace($"Attempting find for {item.Machine.Id}"); Machine machine = null; if (item.Machine.Id != Guid.Empty) @@ -153,16 +141,13 @@ private async Task ProcessMachine(IServiceScope scope, ApplicationDbContext cont if (machine == null) { - _log.Trace("Machine not found by id"); if (!string.IsNullOrEmpty(item.Machine.Name)) { - _log.Trace($"Searching for machine by name {item.Machine.Name}"); machine = context.Machines.FirstOrDefault(o => o.Name == item.Machine.Name); } if (machine == null) { - _log.Trace("Machine is still null, so attempting another create"); if (item.Machine.Id == Guid.Empty) item.Machine.Id = Guid.NewGuid(); item.Machine.LastReportedUtc = DateTime.UtcNow; @@ -187,8 +172,6 @@ private async Task ProcessMachine(IServiceScope scope, ApplicationDbContext cont CreatedUtc = DateTime.UtcNow }); - _log.Trace($"Proc history type: {item.HistoryType}"); - if (item.HistoryType == Machine.MachineHistoryItem.HistoryType.PostedResults) { if (item.LogDump.Log.Length > 0) diff --git a/src/Ghosts.Api/ghosts.api.csproj b/src/Ghosts.Api/ghosts.api.csproj index b319c011..0d173c6f 100644 --- a/src/Ghosts.Api/ghosts.api.csproj +++ b/src/Ghosts.Api/ghosts.api.csproj @@ -5,7 +5,7 @@ ghosts.api 8.0.0.0 - 8.0.7.50 + 8.0.7.65 GHOSTS Development Squad for CERT > Software Engineering Institute > Carnegie Mellon University Carnegie Mellon University