Skip to content

Commit

Permalink
Use TryAddSingleton when registering default member store (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker authored May 2, 2023
1 parent 1c69cc5 commit 3b47616
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Azure.ResourceManager;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Proto.Cluster.AzureContainerApps.Stores.ResourceTags;
Expand Down Expand Up @@ -33,7 +34,7 @@ public static IServiceCollection AddAzureContainerAppsProvider(this IServiceColl
services.AddSingleton(armClientProvider);

// Register the default member store.
services.AddSingleton<IClusterMemberStore, ResourceTagsClusterMemberStore>(sp =>
services.TryAddSingleton<IClusterMemberStore>(sp =>
{
var clientProvider = sp.GetRequiredService<IArmClientProvider>();
var logger = sp.GetRequiredService<ILogger<ResourceTagsClusterMemberStore>>();
Expand Down

0 comments on commit 3b47616

Please sign in to comment.