Skip to content

Commit

Permalink
fix null
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Aug 6, 2024
1 parent 7df9cd2 commit 3ead432
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ private async Task ProcessStats(List<GithubTargetConfiguration> targetConfig)

var jobsByState = await db.Jobs.GroupBy(x => x.State).Select(x => new { x.Key, Count = x.Count() }).ToListAsync();

QueuedJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.Queued)!.Count);
CompletedJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.Completed)!.Count);
InProgressJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.InProgress)!.Count);
QueuedJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.Queued)?.Count ?? 0);
CompletedJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.Completed)?.Count ?? 0);
InProgressJobsCount.Set(jobsByState.FirstOrDefault(x => x.Key == JobState.InProgress)?.Count ?? 0);

// grab runner state counts

Expand Down

0 comments on commit 3ead432

Please sign in to comment.