Skip to content

Commit

Permalink
Don't crash with mulitple tasks of the same name #606
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Jan 23, 2025
1 parent 62091bb commit fbdae7f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ await _clearMLService.GetTasksByIdAsync(
.Values.Where(t => t.Status is ClearMLTaskStatus.Queued or ClearMLTaskStatus.Created)
.OrderBy(t => t.Created)
.Select((t, i) => (Position: i, Task: t))
.ToDictionary(e => e.Task.Name, e => e.Position);
.GroupBy(e => e.Task.Name)
.ToDictionary(e => e.Key, e => e.First().Position);

_queueSizePerEngineType[engineType] = queuePositionsPerEngineType[engineType].Count;
}
Expand Down

0 comments on commit fbdae7f

Please sign in to comment.