File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -470,13 +470,16 @@ function Start-Htmx {
470
470
471
471
# If we haven't determined the server URL, we will do so now.
472
472
if (-not $serverJob.ServerUrl ) {
473
- $prefixes = $HttpListener.Prefixes -as [string []]
473
+ $prefixes = $HttpListener.Prefixes -as [string []]
474
474
$ServerUrl = $prefixes [0 ]
475
475
$serverJob.psobject.properties.add (
476
476
[psnoteproperty ]::new(' ServerUrl' , $ServerUrl ), $true
477
477
)
478
478
}
479
479
480
+ while ($serverJob.JobStateInfo.State -eq ' NotStarted' ) {
481
+ Start-Sleep - Milliseconds (Get-Random - Maximum 20 - Minimum 1 )
482
+ }
480
483
$serverJob
481
484
}
482
485
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ describe HtmxPS {
24
24
$startedLocalJob = Start-Htmx - Htmx (
25
25
htmx button " Click Me" hx- on:click= " alert('Thanks, I needed that!')"
26
26
) - ServerUrl " http://127.0.0.1:8080/"
27
- Start-Sleep - Seconds 1
27
+ # Start-Sleep -Seconds 1
28
28
Invoke-RestMethod - Uri $startedLocalJob.ServerUrl
29
29
$startedLocalJob | Stop-Htmx
30
30
$startedLocalJob | Remove-Job
You can’t perform that action at this time.
0 commit comments