Skip to content

Commit

Permalink
Revert "fix(ef-core): verify Client.Guid is not null before parsing"
Browse files Browse the repository at this point in the history
This reverts commit 179a977.
  • Loading branch information
harlam357 committed May 22, 2022
1 parent 179a977 commit ab21257
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/HFM.Core/Data/ProteinBenchmarkRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ public async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentifi
public async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable<int> projects) =>
await GetBenchmarksAsync(slotIdentifier, projects, null).ConfigureAwait(false);

private async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable<int> projects, int? count)
{
var query = await QueryWorkUnitsByClientSlot(slotIdentifier, _context)
private async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable<int> projects, int? count) =>
(await QueryWorkUnitsByClientSlot(slotIdentifier, _context)
.Include(x => x.Protein)
.Include(x => x.Client)
.Include(x => x.Platform)
Expand All @@ -194,13 +193,11 @@ private async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentif
.OrderByDescending(y => y.FrameID))
.Where(x => projects.Contains(x.Protein.ProjectID) && x.Frames.Any())
.OrderByDescending(x => x.ID)
.ToListAsync().ConfigureAwait(false);

return query
.ToListAsync().ConfigureAwait(false))
.GroupBy(x =>
(SlotIdentifier: new SlotIdentifier(
ClientIdentifier.FromConnectionString(
x.Client.Name, x.Client.ConnectionString, x.Client.Guid is null ? Guid.Empty : Guid.Parse(x.Client.Guid)),
x.Client.Name, x.Client.ConnectionString, Guid.Parse(x.Client.Guid)),
x.ClientSlot ?? SlotIdentifier.NoSlotID),
BenchmarkIdentifier: new ProteinBenchmarkIdentifier(
x.Protein.ProjectID, x.Platform?.Processor, x.Platform?.Threads ?? ProteinBenchmarkIdentifier.NoThreads)))
Expand All @@ -222,7 +219,6 @@ private async Task<ICollection<ProteinBenchmark>> GetBenchmarksAsync(SlotIdentif
})
.TakeWhile((_, i) => !count.HasValue || i < count)
.ToList();
}

private static IQueryable<WorkUnitEntity> QueryWorkUnitsByClientSlot(SlotIdentifier slotIdentifier, WorkUnitContext context)
{
Expand Down

0 comments on commit ab21257

Please sign in to comment.