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() ...@@ -255,7 +255,7 @@ internal void KeepAlive()
else if (commandMap.IsAvailable(RedisCommand.UNSUBSCRIBE)) else if (commandMap.IsAvailable(RedisCommand.UNSUBSCRIBE))
{ {
msg = Message.Create(-1, CommandFlags.FireAndForget, RedisCommand.UNSUBSCRIBE, msg = Message.Create(-1, CommandFlags.FireAndForget, RedisCommand.UNSUBSCRIBE,
(RedisChannel)Guid.NewGuid().ToByteArray()); (RedisChannel)Multiplexer.UniqueId);
msg.SetSource(ResultProcessor.TrackSubscriptions, null); msg.SetSource(ResultProcessor.TrackSubscriptions, null);
} }
break; break;
......
...@@ -349,7 +349,7 @@ private Message CreatePingMessage(CommandFlags flags, out ServerEndPoint server) ...@@ -349,7 +349,7 @@ private Message CreatePingMessage(CommandFlags flags, out ServerEndPoint server)
else else
{ {
// can't use regular PING, but we can unsubscribe from something random that we weren't even subscribed to... // 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); return ResultProcessor.TimingProcessor.CreateMessage(-1, flags, RedisCommand.UNSUBSCRIBE, channel);
} }
} }
......
...@@ -300,7 +300,7 @@ internal void AutoConfigure(PhysicalConnection connection) ...@@ -300,7 +300,7 @@ internal void AutoConfigure(PhysicalConnection connection)
else if (commandMap.IsAvailable(RedisCommand.SET)) 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... // 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 = Message.Create(0, flags, RedisCommand.SET, key, RedisLiterals.slave_read_only, RedisLiterals.PX, 1, RedisLiterals.NX);
msg.SetInternalCall(); msg.SetInternalCall();
WriteDirectOrQueueFireAndForget(connection, msg, ResultProcessor.AutoConfigure); 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