Skip to content

Commit

Permalink
Merge pull request #246 from cnblogs/fix-node-locator-setting
Browse files Browse the repository at this point in the history
fix: set UseLegacyNodeLocator before SetNodeLocator
  • Loading branch information
cnblogs-dudu authored Dec 9, 2024
2 parents b25aabc + 0e26ec0 commit d25f5ec
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Enyim.Caching/Configuration/MemcachedClientConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ public MemcachedClientConfiguration(
}
#endif

_useLegacyNodeLocator = options.UseLegacyNodeLocator;
ConfigureServers(options);
if (NodeLocator == null)
{
SetNodeLocator();
}

SocketPool = new SocketPoolConfiguration();
if (options.SocketPool != null)
Expand Down Expand Up @@ -155,12 +160,6 @@ public MemcachedClientConfiguration(
_logger.LogDebug($"Use KeyTransformer Type : '{keyTransformer}'");
}

_useLegacyNodeLocator = options.UseLegacyNodeLocator;
if (NodeLocator == null)
{
SetNodeLocator();
}

if (!string.IsNullOrEmpty(options.Transcoder))
{
try
Expand Down Expand Up @@ -234,7 +233,7 @@ private void SetNodeLocator()
NodeLocator = typeof(SingleNodeLocator);
}

_logger.LogDebug("Use NodeLocator: {NodeLocator}", NodeLocator);
_logger.LogDebug("Use NodeLocator: {NodeLocator}. Current server count: {serverCount}", NodeLocator, Servers.Count);
}

/// <summary>
Expand Down

0 comments on commit d25f5ec

Please sign in to comment.