Commit 68af2f79 authored by Marc Gravell's avatar Marc Gravell

no need to keep generating guids

parent 61f7bff8
......@@ -255,7 +255,7 @@ internal void KeepAlive()
else if (commandMap.IsAvailable(RedisCommand.UNSUBSCRIBE))
{
msg = Message.Create(-1, CommandFlags.FireAndForget, RedisCommand.UNSUBSCRIBE,
(RedisChannel)Guid.NewGuid().ToByteArray());
(RedisChannel)Multiplexer.UniqueId);
msg.SetSource(ResultProcessor.TrackSubscriptions, null);
}
break;
......
......@@ -349,7 +349,7 @@ private Message CreatePingMessage(CommandFlags flags, out ServerEndPoint server)
else
{
// can't use regular PING, but we can unsubscribe from something random that we weren't even subscribed to...
RedisValue channel = Guid.NewGuid().ToByteArray();
RedisValue channel = multiplexer.UniqueId;
return ResultProcessor.TimingProcessor.CreateMessage(-1, flags, RedisCommand.UNSUBSCRIBE, channel);
}
}
......
......@@ -300,7 +300,7 @@ internal void AutoConfigure(PhysicalConnection connection)
else if (commandMap.IsAvailable(RedisCommand.SET))
{
// this is a nasty way to find if we are a slave, and it will only work on up-level servers, but...
RedisKey key = Guid.NewGuid().ToByteArray();
RedisKey key = Multiplexer.UniqueId;
msg = Message.Create(0, flags, RedisCommand.SET, key, RedisLiterals.slave_read_only, RedisLiterals.PX, 1, RedisLiterals.NX);
msg.SetInternalCall();
WriteDirectOrQueueFireAndForget(connection, msg, ResultProcessor.AutoConfigure);
......
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