Skip to content

Commit

Permalink
Merge pull request #428 from cmu-sei/v8
Browse files Browse the repository at this point in the history
fixes #425 - incorrect configuration passed into chat job
  • Loading branch information
sei-dupdyke authored Oct 9, 2024
2 parents c0d123b + 4434431 commit 32bb34a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,8 +31,7 @@ public ChatJob(ApplicationSettings.AnimatorSettingsDetail.AnimationsSettings.Cha
IHubContext<ActivityHub> activityHubContext, CancellationToken cancellationToken)
{
//todo: post results to activityHubContext for "top" reporting

this._configuration = configuration;

this._random = random;

using var innerScope = scopeFactory.CreateScope();
Expand All @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ghosts.Api/ghosts.api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>ghosts.api</AssemblyName>

<AssemblyVersion>8.0.0.0</AssemblyVersion>
<FileVersion>8.2.2.0</FileVersion>
<FileVersion>8.2.404.0</FileVersion>

<Authors>GHOSTS Development Team for CERT > Software Engineering Institute > Carnegie Mellon University</Authors>
<Company>Carnegie Mellon University</Company>
Expand Down

0 comments on commit 32bb34a

Please sign in to comment.