From e671209348d930940985d0b03bd2a5f61e593293 Mon Sep 17 00:00:00 2001 From: Mark Cilia Vincenti Date: Sun, 20 Sep 2026 12:55:43 +0200 Subject: [PATCH] Use the AsyncKeyedMemoryLocker --- src/KubeOps.Abstractions/KubeOps.Abstractions.csproj | 2 +- src/KubeOps.Operator/Builder/CacheExtensions.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/KubeOps.Abstractions/KubeOps.Abstractions.csproj b/src/KubeOps.Abstractions/KubeOps.Abstractions.csproj index 372cb68ba..418cd523f 100644 --- a/src/KubeOps.Abstractions/KubeOps.Abstractions.csproj +++ b/src/KubeOps.Abstractions/KubeOps.Abstractions.csproj @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/src/KubeOps.Operator/Builder/CacheExtensions.cs b/src/KubeOps.Operator/Builder/CacheExtensions.cs index bfe32ea5a..b65011b81 100644 --- a/src/KubeOps.Operator/Builder/CacheExtensions.cs +++ b/src/KubeOps.Operator/Builder/CacheExtensions.cs @@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection; using ZiggyCreatures.Caching.Fusion; +using ZiggyCreatures.Caching.Fusion.Locking.AsyncKeyed; namespace KubeOps.Operator.Builder; @@ -29,7 +30,8 @@ internal static IServiceCollection WithResourceWatcherEntityCaching(this IServic { var cacheName = CacheConstants.ResourceWatcherCacheNameFor(settings.ReconcileStrategy); - var builder = services.AddFusionCache(cacheName); + var builder = services.AddFusionCache(cacheName) + .WithMemoryLocker(new AsyncKeyedMemoryLocker()); if (settings.ConfigureResourceWatcherEntityCache != null) {