From 44344315fe71430d8cd9b0e7a05b108e89efeeed Mon Sep 17 00:00:00 2001 From: Dustin Updyke Date: Wed, 9 Oct 2024 11:30:36 -0400 Subject: [PATCH] fixes #425 - incorrect configuration passed into chat job --- .../Animations/AnimationDefinitions/ChatJob.cs | 12 +++++------- src/Ghosts.Api/ghosts.api.csproj | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Ghosts.Api/Infrastructure/Animations/AnimationDefinitions/ChatJob.cs b/src/Ghosts.Api/Infrastructure/Animations/AnimationDefinitions/ChatJob.cs index 7e11578e..20bbfc41 100644 --- a/src/Ghosts.Api/Infrastructure/Animations/AnimationDefinitions/ChatJob.cs +++ b/src/Ghosts.Api/Infrastructure/Animations/AnimationDefinitions/ChatJob.cs @@ -20,7 +20,6 @@ namespace ghosts.api.Infrastructure.Animations.AnimationDefinitions; public class ChatJob { private static readonly Logger _log = LogManager.GetCurrentClassLogger(); - private readonly ApplicationSettings.AnimatorSettingsDetail.AnimationsSettings.ChatSettings _configuration; private readonly ApplicationDbContext _context; private readonly Random _random; private readonly ChatClient _chatClient; @@ -32,8 +31,7 @@ public ChatJob(ApplicationSettings.AnimatorSettingsDetail.AnimationsSettings.Cha IHubContext activityHubContext, CancellationToken cancellationToken) { //todo: post results to activityHubContext for "top" reporting - - this._configuration = configuration; + this._random = random; using var innerScope = scopeFactory.CreateScope(); @@ -45,20 +43,20 @@ public ChatJob(ApplicationSettings.AnimatorSettingsDetail.AnimationsSettings.Cha new JsonSerializerOptions { PropertyNameCaseInsensitive = true }) ?? throw new InvalidOperationException(); this._formatterService = - new ContentCreationService(_configuration.ContentEngine).FormatterService; + new ContentCreationService(configuration.ContentEngine).FormatterService; - this._chatClient = new ChatClient(_configuration, chatConfiguration, this._formatterService, activityHubContext, this._cancellationToken); + this._chatClient = new ChatClient(configuration, chatConfiguration, this._formatterService, activityHubContext, this._cancellationToken); while (!_cancellationToken.IsCancellationRequested) { - if (this._currentStep > _configuration.MaximumSteps) + if (this._currentStep > configuration.MaximumSteps) { _log.Trace($"Maximum steps met: {this._currentStep - 1}. Chat Job is exiting..."); return; } this.Step(random, chatConfiguration); - Thread.Sleep(this._configuration.TurnLength); + Thread.Sleep(configuration.TurnLength); this._currentStep++; } diff --git a/src/Ghosts.Api/ghosts.api.csproj b/src/Ghosts.Api/ghosts.api.csproj index 9793d4a1..413b2aa6 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.2.2.0 + 8.2.404.0 GHOSTS Development Team for CERT > Software Engineering Institute > Carnegie Mellon University Carnegie Mellon University