Commit cd044317 authored by Marc Gravell's avatar Marc Gravell

typo; send the right message; also, try to do the PUBLISH *after* the slaveof

parent 4b3691a9
...@@ -568,7 +568,7 @@ public void SlaveOf(EndPoint endpoint, CommandFlags flags = CommandFlags.None) ...@@ -568,7 +568,7 @@ public void SlaveOf(EndPoint endpoint, CommandFlags flags = CommandFlags.None)
throw new ArgumentException("Cannot slave to self"); throw new ArgumentException("Cannot slave to self");
} }
// prepare the actual slaveof message (not sent yet) // prepare the actual slaveof message (not sent yet)
var msg = CreateSlaveOfMessage(endpoint, flags); var slaveofMsg = CreateSlaveOfMessage(endpoint, flags);
var configuration = this.multiplexer.RawConfig; var configuration = this.multiplexer.RawConfig;
...@@ -582,16 +582,16 @@ public void SlaveOf(EndPoint endpoint, CommandFlags flags = CommandFlags.None) ...@@ -582,16 +582,16 @@ public void SlaveOf(EndPoint endpoint, CommandFlags flags = CommandFlags.None)
del.SetInternalCall(); del.SetInternalCall();
server.QueueDirectFireAndForget(del, ResultProcessor.Boolean); server.QueueDirectFireAndForget(del, ResultProcessor.Boolean);
} }
ExecuteSync(slaveofMsg, ResultProcessor.DemandOK);
// attempt to broadcast a reconfigure message to anybody listening to this server // attempt to broadcast a reconfigure message to anybody listening to this server
var channel = this.multiplexer.ConfigurationChangedChannel; var channel = this.multiplexer.ConfigurationChangedChannel;
if(channel != null && this.multiplexer.CommandMap.IsAvailable(RedisCommand.PUBLISH)) if (channel != null && this.multiplexer.CommandMap.IsAvailable(RedisCommand.PUBLISH))
{ {
var pub = Message.Create(-1, CommandFlags.FireAndForget | CommandFlags.NoRedirect, RedisCommand.PUBLISH, (RedisValue)channel, RedisLiterals.Wildcard); var pub = Message.Create(-1, CommandFlags.FireAndForget | CommandFlags.NoRedirect, RedisCommand.PUBLISH, (RedisValue)channel, RedisLiterals.Wildcard);
pub.SetInternalCall(); pub.SetInternalCall();
server.QueueDirectFireAndForget(msg, ResultProcessor.Int64); server.QueueDirectFireAndForget(pub, ResultProcessor.Int64);
} }
ExecuteSync(msg, ResultProcessor.DemandOK);
} }
public Task SlaveOfAsync(EndPoint endpoint, CommandFlags flags = CommandFlags.None) public Task SlaveOfAsync(EndPoint endpoint, CommandFlags flags = CommandFlags.None)
......
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