Commit a569aa9b authored by Bryan Ross's avatar Bryan Ross

Use the supplied flags when selecting a server to subscribe to

SUBSCRIBE and PSUBSCRIBE are not write ops and can be
performed on slaved instances, so there's no reason to
explicitly pass DemandMaster when selecting the server.

Instead, use the CommandFlags passed as the parameter to Subscribe()
parent a194c28d
...@@ -185,7 +185,7 @@ public bool Remove(Action<RedisChannel, RedisValue> value) ...@@ -185,7 +185,7 @@ public bool Remove(Action<RedisChannel, RedisValue> value)
public Task SubscribeToServer(ConnectionMultiplexer multiplexer, RedisChannel channel, CommandFlags flags, object asyncState, bool internalCall) public Task SubscribeToServer(ConnectionMultiplexer multiplexer, RedisChannel channel, CommandFlags flags, object asyncState, bool internalCall)
{ {
var cmd = channel.IsPatternBased ? RedisCommand.PSUBSCRIBE : RedisCommand.SUBSCRIBE; var cmd = channel.IsPatternBased ? RedisCommand.PSUBSCRIBE : RedisCommand.SUBSCRIBE;
var selected = multiplexer.SelectServer(-1, cmd, CommandFlags.DemandMaster, default(RedisKey)); var selected = multiplexer.SelectServer(-1, cmd, flags, default(RedisKey));
if (selected == null || Interlocked.CompareExchange(ref owner, selected, null) != null) return null; if (selected == null || Interlocked.CompareExchange(ref owner, selected, null) != null) return null;
......
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