Commit 1b60d3b2 authored by Marc Gravell's avatar Marc Gravell

we should check that PING is available, at least

parent 7f807f13
......@@ -88,7 +88,7 @@ internal Task RemoveAllSubscriptions(CommandFlags flags, object asyncState)
foreach (var pair in subscriptions)
{
var msg = pair.Value.ForSyncShutdown();
if(msg != null) UnprocessableCompletionManager.CompleteSyncOrAsync(msg);
if (msg != null) UnprocessableCompletionManager.CompleteSyncOrAsync(msg);
pair.Value.Remove(true, null);
pair.Value.Remove(false, null);
......@@ -332,9 +332,13 @@ public override Task<TimeSpan> PingAsync(CommandFlags flags = CommandFlags.None)
private Message CreatePingMessage(CommandFlags flags, out ServerEndPoint server)
{
bool usePing;
try { usePing = GetFeatures(-1, default, flags, out server).PingOnSubscriber; }
catch { usePing = false; server = null; }
bool usePing = false;
server = null;
if (multiplexer.CommandMap.IsAvailable(RedisCommand.PING))
{
try { usePing = GetFeatures(-1, default, flags, out server).PingOnSubscriber; }
catch { }
}
if (usePing)
{
......
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