Skip to content

Commit 82bf7ec

Browse files
authored
🎉 Allow Configurable Timeout for HTTPS Sessions (#87)
Fixes #85
1 parent 13a69aa commit 82bf7ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ModuleFast.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ function New-ModuleFastClient {
458458
$httpClient = [HttpClient]::new($httpHandler)
459459
$httpClient.BaseAddress = $Source
460460
#When in parallel some operations may take a significant amount of time to return
461-
$httpClient.Timeout = [TimeSpan]::FromSeconds(30)
461+
$httpClient.Timeout = [TimeSpan]::FromSeconds($Timeout)
462462

463463
#If a credential was provided, use it as a basic auth credential
464464
if ($Credential) {
@@ -884,7 +884,8 @@ function Install-ModuleFastHelper {
884884
[Parameter(Mandatory)][CancellationToken]$CancellationToken,
885885
[HttpClient]$HttpClient,
886886
[switch]$Update,
887-
[int]$ThrottleLimit
887+
[int]$ThrottleLimit,
888+
[int]$Timeout = 30
888889
)
889890
BEGIN {
890891
#We use this token to cancel the HTTP requests if the user hits ctrl-C without having to dispose of the HttpClient.

0 commit comments

Comments
 (0)