Skip to content

Commit

Permalink
Update AvaTaxClient to obtain timeout timespan from UserConfiguration…
Browse files Browse the repository at this point in the history
….GetTimeOutTimeSpan

Change in support of allowing timeout to be specified in seconds instead of minutes.
  • Loading branch information
steve-sweitzer authored Oct 14, 2024
1 parent 33385cd commit 6e119d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/AvaTaxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public AvaTaxClient(string appName, string appVersion, string machineName, AvaTa
_userConfiguration = userConfiguration;
}
#if PORTABLE
this.httpClient = new HttpClient() { Timeout = TimeSpan.FromMinutes(_userConfiguration.TimeoutInMinutes) };
this.httpClient = new HttpClient() { Timeout = _userConfiguration.GetTimeOutTimeSpan() };
#endif

// Setup the URI
Expand Down Expand Up @@ -118,7 +118,7 @@ public AvaTaxClient(string appName, string appVersion, string machineName, Uri c
_userConfiguration = userConfiguration;
}
#if PORTABLE
this.httpClient = new HttpClient() { Timeout = TimeSpan.FromMinutes(_userConfiguration.TimeoutInMinutes) };
this.httpClient = new HttpClient() { Timeout = _userConfiguration.GetTimeOutTimeSpan() };
#endif
_envUri = customEnvironment;
}
Expand All @@ -145,7 +145,7 @@ public AvaTaxClient(HttpClient httpClient, string appName, string appVersion, st
}

this.httpClient = httpClient ?? new HttpClient()
{ Timeout = TimeSpan.FromMinutes(_userConfiguration.TimeoutInMinutes) };
{ Timeout = _userConfiguration.GetTimeOutTimeSpan() };

// Setup the URI
switch (environment)
Expand Down Expand Up @@ -181,7 +181,7 @@ public AvaTaxClient(HttpClient httpClient, string appName, string appVersion, st
}

this.httpClient = httpClient ?? new HttpClient()
{ Timeout = TimeSpan.FromMinutes(_userConfiguration.TimeoutInMinutes) };
{ Timeout = _userConfiguration.GetTimeOutTimeSpan() };

_envUri = customEnvironment;
}
Expand Down Expand Up @@ -1169,4 +1169,4 @@ private void LogFile_CallCompleted(object sender, EventArgs e)

#endregion
}
}
}

0 comments on commit 6e119d9

Please sign in to comment.