Commit 9cfa0435 authored by mgravell's avatar mgravell

need to allow the GetServer API to expose KEYS/SCAN, which is supported

parent 8c62c8f7
...@@ -1333,7 +1333,6 @@ public IServer GetServer(EndPoint endpoint, object asyncState = null) ...@@ -1333,7 +1333,6 @@ public IServer GetServer(EndPoint endpoint, object asyncState = null)
if (endpoint == null) throw new ArgumentNullException(nameof(endpoint)); if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
switch (RawConfig.Proxy) switch (RawConfig.Proxy)
{ {
case Proxy.RedisClusterProxy:
case Proxy.Twemproxy: case Proxy.Twemproxy:
throw new NotSupportedException($"The server API is not available via {RawConfig.Proxy}"); throw new NotSupportedException($"The server API is not available via {RawConfig.Proxy}");
} }
......
...@@ -23,10 +23,11 @@ public void CanConnectToClusterProxy() ...@@ -23,10 +23,11 @@ public void CanConnectToClusterProxy()
Assert.Equal(expected, actual); Assert.Equal(expected, actual);
// check it knows that we're dealing with a cluster // check it knows that we're dealing with a cluster
var ex = Assert.Throws<NotSupportedException>(() => conn.GetServer("abc")); var server = conn.GetServer(conn.GetEndPoints()[0]);
Assert.Equal("The server API is not available via RedisClusterProxy", ex.Message); Assert.Equal(ServerType.RedisClusterProxy, server.ServerType);
_ = server.Echo("abc");
ex = Assert.Throws<NotSupportedException>(() => conn.GetSubscriber("abc")); var ex = Assert.Throws<NotSupportedException>(() => conn.GetSubscriber("abc"));
Assert.Equal("The pub/sub API is not available via RedisClusterProxy", ex.Message); Assert.Equal("The pub/sub API is not available via RedisClusterProxy", ex.Message);
// test a script // test a script
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment