Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump RestSharp from 110.1.0 to 111.2.0 #640

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client.Core/Client.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NodaTime" Version="3.1.11" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.1.0" />
<PackageReference Include="RestSharp" Version="110.1.0" />
<PackageReference Include="RestSharp" Version="111.2.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Client.Core/Internal/RestSharpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal static RestRequest AddAdvancedResponseHandler(this RestRequest restRequ
internal static RestResponse ExecuteSync(this RestClient client,
RestRequest request, CancellationToken cancellationToken = default)
{
return client.Execute(request, cancellationToken);
return client.Execute(request, request.Method);
}
}
}
2 changes: 1 addition & 1 deletion Client.Legacy/FluxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public FluxClient(FluxConnectionOptions options) : base(new FluxResultMapper())
var version = AssemblyHelper.GetVersion(typeof(FluxClient));
var restClientOptions = new RestClientOptions(options.Url)
{
MaxTimeout = (int)options.Timeout.TotalMilliseconds,
Timeout = TimeSpan.FromMilliseconds(options.Timeout.TotalMilliseconds),
UserAgent = $"influxdb-client-csharp/{version}",
Proxy = options.WebProxy
};
Expand Down
20 changes: 10 additions & 10 deletions Client.Test/InfluxDbClientFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void LoadFromConnectionString()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -160,7 +160,7 @@ public void LoadFromConnectionStringFactory()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -178,7 +178,7 @@ public void LoadFromConnectionStringUnitsMillisecondsSeconds()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -197,7 +197,7 @@ public void LoadFromConnectionStringUnitsMillisecondsSecondsFactory()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -215,7 +215,7 @@ public void LoadFromConnectionStringUnitsMinutes()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -234,7 +234,7 @@ public void LoadFromConnectionStringUnitsMinutesFactory()
Assert.AreEqual(LogLevel.Headers, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(1, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(1, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand Down Expand Up @@ -297,7 +297,7 @@ public void LoadFromConfiguration()
Assert.AreEqual(LogLevel.Body, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(10_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(10_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);

var defaultTags = GetDeclaredField<SortedDictionary<string, string>>(options.PointSettings.GetType(),
options.PointSettings, "_defaultTags");
Expand All @@ -324,7 +324,7 @@ public void LoadFromConfigurationOptions()
Assert.AreEqual(LogLevel.Body, _client.GetLogLevel());

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(10_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(10_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);

var defaultTags = GetDeclaredField<SortedDictionary<string, string>>(options.PointSettings.GetType(),
options.PointSettings, "_defaultTags");
Expand Down Expand Up @@ -416,7 +416,7 @@ public void Timeout()
_client = new InfluxDBClient(options);

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(20_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(20_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand All @@ -432,7 +432,7 @@ public void TimeoutFactory()
_client = InfluxDBClientFactory.Create(options);

var apiClient = GetDeclaredField<ApiClient>(_client.GetType(), _client, "_apiClient");
Assert.AreEqual(20_000, apiClient.RestClientOptions.MaxTimeout);
Assert.AreEqual(20_000, apiClient.RestClientOptions.Timeout.Value.TotalMilliseconds);
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion Client/Internal/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ApiClient(InfluxDBClientOptions options, LoggingHandler loggingHandler, G
var version = AssemblyHelper.GetVersion(typeof(InfluxDBClient));
RestClientOptions = new RestClientOptions(options.Url)
{
MaxTimeout = (int)options.Timeout.TotalMilliseconds,
Timeout = TimeSpan.FromMilliseconds(options.Timeout.TotalMilliseconds),
UserAgent = $"influxdb-client-csharp/{version}",
Proxy = options.WebProxy,
FollowRedirects = options.AllowHttpRedirects,
Expand Down