We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GetOrCreateBoundConfiguration
1 parent 1e3422b commit f868b89Copy full SHA for f868b89
src/Elastic.Transport/DistributedTransport.cs
@@ -305,13 +305,20 @@ BoundConfiguration GetOrCreateBoundConfiguration(RequestConfiguration rc)
305
return boundConfiguration;
306
}
307
308
+#if NET8_0_OR_GREATER
309
boundConfiguration = new BoundConfiguration(Configuration, rc);
310
-#if NET8_0_OR_GREATER
311
cache.TryAdd(rc, boundConfiguration);
312
#else
313
lock (cache)
314
{
315
+ if (cache.TryGetValue(rc, out boundConfiguration))
316
+ {
317
+ return boundConfiguration;
318
+ }
319
+
320
+ boundConfiguration = new BoundConfiguration(Configuration, rc);
321
322
cache.Add(rc, boundConfiguration);
323
324
#endif
0 commit comments