Commit 91daba50 authored by Hans Kuder's avatar Hans Kuder Committed by Marc Gravell

Remove obsolete responseTimeout setting (#1042)

* Remove obsolete responseTimeout setting

* fix bad autocomplete
parent ec5ba309
...@@ -335,7 +335,8 @@ public bool PreserveAsyncOrder ...@@ -335,7 +335,8 @@ public bool PreserveAsyncOrder
/// Specifies the time in milliseconds that the system should allow for responses before concluding that the socket is unhealthy /// Specifies the time in milliseconds that the system should allow for responses before concluding that the socket is unhealthy
/// (defaults to SyncTimeout) /// (defaults to SyncTimeout)
/// </summary> /// </summary>
public int ResponseTimeout { get { return responseTimeout ?? SyncTimeout; } set { responseTimeout = value; } } [Obsolete("This setting no longer has any effect, and should not be used")]
public int ResponseTimeout { get { return 0; } set { } }
/// <summary> /// <summary>
/// The service name used to resolve a service via sentinel. /// The service name used to resolve a service via sentinel.
...@@ -701,7 +702,9 @@ private void DoParse(string configuration, bool ignoreUnknown) ...@@ -701,7 +702,9 @@ private void DoParse(string configuration, bool ignoreUnknown)
Proxy = OptionKeys.ParseProxy(key, value); Proxy = OptionKeys.ParseProxy(key, value);
break; break;
case OptionKeys.ResponseTimeout: case OptionKeys.ResponseTimeout:
#pragma warning disable CS0618 // Type or member is obsolete
ResponseTimeout = OptionKeys.ParseInt32(key, value, minValue: 1); ResponseTimeout = OptionKeys.ParseInt32(key, value, minValue: 1);
#pragma warning restore CS0618 // Type or member is obsolete
break; break;
case OptionKeys.DefaultDatabase: case OptionKeys.DefaultDatabase:
DefaultDatabase = OptionKeys.ParseInt32(key, value); DefaultDatabase = OptionKeys.ParseInt32(key, value);
......
...@@ -40,6 +40,18 @@ public void WriteBufferParse() ...@@ -40,6 +40,18 @@ public void WriteBufferParse()
options = ConfigurationOptions.Parse("writeBuffer=8092"); options = ConfigurationOptions.Parse("writeBuffer=8092");
Assert.Equal(0, options.WriteBuffer); Assert.Equal(0, options.WriteBuffer);
} }
[Fact]
public void ResponseTimeout()
{
Assert.True(Attribute.IsDefined(typeof(ConfigurationOptions).GetProperty(nameof(ConfigurationOptions.ResponseTimeout)), typeof(ObsoleteAttribute)));
var options = ConfigurationOptions.Parse("name=Hello");
Assert.Equal(0, options.ResponseTimeout);
options = ConfigurationOptions.Parse("responseTimeout=1000");
Assert.Equal(0, options.ResponseTimeout);
}
#pragma warning restore CS0618 // Type or member is obsolete #pragma warning restore CS0618 // Type or member is obsolete
} }
} }
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