diff --git a/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs b/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs index ba2feadcf..1c7adf3a9 100644 --- a/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs +++ b/src/SIL.Machine.AspNetCore/Models/ClearMLTask.cs @@ -20,11 +20,11 @@ public record ClearMLTask public required string Name { get; init; } public required ClearMLProject Project { get; init; } public required ClearMLTaskStatus Status { get; init; } - public required string StatusReason { get; init; } - public required string StatusMessage { get; init; } + public string? StatusReason { get; init; } + public string? StatusMessage { get; init; } public required DateTime Created { get; init; } - public required int LastIteration { get; init; } - public required int ActiveDuration { get; init; } + public int? LastIteration { get; init; } + public int ActiveDuration { get; init; } public required IReadOnlyDictionary< string, IReadOnlyDictionary diff --git a/src/SIL.Machine.AspNetCore/Services/ClearMLMonitorService.cs b/src/SIL.Machine.AspNetCore/Services/ClearMLMonitorService.cs index 58b537494..f166dabaf 100644 --- a/src/SIL.Machine.AspNetCore/Services/ClearMLMonitorService.cs +++ b/src/SIL.Machine.AspNetCore/Services/ClearMLMonitorService.cs @@ -110,7 +110,7 @@ await UpdateTrainJobStatus( platformService, engine.CurrentBuild.BuildId, new ProgressStatus( - task.LastIteration, + task.LastIteration ?? 0, percentCompleted: GetMetric(task, SummaryMetric, ProgressVariant) ), 0, @@ -122,7 +122,7 @@ await UpdateTrainJobStatus( await UpdateTrainJobStatus( platformService, engine.CurrentBuild.BuildId, - new ProgressStatus(task.LastIteration, percentCompleted: 1.0), + new ProgressStatus(task.LastIteration ?? 0, percentCompleted: 1.0), 0, cancellationToken );