Skip to content

Commit

Permalink
refactor: adapt configuration key for request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Oct 13, 2023
1 parent 4856bb0 commit 975e732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Vonage.Test.Unit/ConfigurationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void FromConfiguration_ShouldSetRequestTimeout_GivenConfigurationContains
Configuration.FromConfiguration(new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string>
{
{"appSettings:Vonage.RequestsTimeout", "100"},
{"appSettings:Vonage.RequestTimeout", "100"},
})
.Build()).RequestTimeout.Should().BeSome(TimeSpan.FromSeconds(100));

Expand Down
4 changes: 2 additions & 2 deletions Vonage/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public HttpClient Client
: new Uri(this.Settings["appSettings:Vonage.Url.Api"]);

/// <summary>
/// The timeout (in seconds) applied to every requests. If not provided, the default timeout will be applied.
/// The timeout (in seconds) applied to every request. If not provided, the default timeout will be applied.
/// </summary>
public Maybe<TimeSpan> RequestTimeout =>
int.TryParse(this.Settings["appSettings:Vonage.RequestsTimeout"], out var timeout)
int.TryParse(this.Settings["appSettings:Vonage.RequestTimeout"], out var timeout)
? Maybe<TimeSpan>.Some(TimeSpan.FromSeconds(timeout))
: Maybe<TimeSpan>.None;

Expand Down

0 comments on commit 975e732

Please sign in to comment.