From 6393f39aeaf96d67a525c8fa3f6257d2695a9af7 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Tue, 24 Sep 2024 14:49:22 +1000 Subject: [PATCH] Use HashSet --- src/Aspire.Hosting/Health/ResourceHealthCheckScheduler.cs | 2 +- .../Health/ResourceNotificationHealthCheckPublisher.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Aspire.Hosting/Health/ResourceHealthCheckScheduler.cs b/src/Aspire.Hosting/Health/ResourceHealthCheckScheduler.cs index 89823798a63..6a6b28f8dff 100644 --- a/src/Aspire.Hosting/Health/ResourceHealthCheckScheduler.cs +++ b/src/Aspire.Hosting/Health/ResourceHealthCheckScheduler.cs @@ -13,7 +13,7 @@ internal class ResourceHealthCheckScheduler : BackgroundService private readonly ResourceNotificationService _resourceNotificationService; private readonly DistributedApplicationModel _model; private readonly Dictionary _checkEnablement = new(); - private readonly List _healthyResources = new(); + private readonly HashSet _healthyResources = new(); public ResourceHealthCheckScheduler(ResourceNotificationService resourceNotificationService, DistributedApplicationModel model, IDistributedApplicationEventing eventing) { diff --git a/src/Aspire.Hosting/Health/ResourceNotificationHealthCheckPublisher.cs b/src/Aspire.Hosting/Health/ResourceNotificationHealthCheckPublisher.cs index 6ac43ab79df..bb3ad6fc209 100644 --- a/src/Aspire.Hosting/Health/ResourceNotificationHealthCheckPublisher.cs +++ b/src/Aspire.Hosting/Health/ResourceNotificationHealthCheckPublisher.cs @@ -9,7 +9,7 @@ namespace Aspire.Hosting.Health; internal class ResourceNotificationHealthCheckPublisher(DistributedApplicationModel model, ResourceNotificationService resourceNotificationService, IDistributedApplicationEventing eventing, IServiceProvider services) : IHealthCheckPublisher { - private readonly List _alreadyHealthy = new(); + private readonly HashSet _alreadyHealthy = new(); public async Task PublishAsync(HealthReport report, CancellationToken cancellationToken) {