Skip to content

Commit

Permalink
Update Class.ps1
Browse files Browse the repository at this point in the history
Issue #310: Added default client timeout of 1 minute to help generate error messages when file downloads do not complete.
  • Loading branch information
bk-cs committed Dec 20, 2023
1 parent a72c26d commit 7ec353b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion class/Class.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ class ApiClient {
[System.Net.Http.HttpClient]$Client
[System.Collections.Hashtable]$Collector
ApiClient() {
$this.Collector = $null
$this.Handler = [System.Net.Http.HttpClientHandler]::New()
$this.Client = [System.Net.Http.HttpClient]::New($this.Handler)
$this.Collector = $null
$this.Client.Timeout = [System.TimeSpan]::New(0,1,0)
}
[string] Path([string]$Path) {
$Output = if (![IO.Path]::IsPathRooted($Path)) {
Expand Down

0 comments on commit 7ec353b

Please sign in to comment.