We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b86ac82 commit 664365dCopy full SHA for 664365d
1 file changed
scripts/powershell/maintenance.ps1
@@ -71,9 +71,14 @@ function Start-AllServices {
71
if ($status -and $status.Status -eq 'Running') { break }
72
Start-Sleep -Milliseconds 500
73
}
74
+ $stopwatch.Stop()
75
- Write-Log "$($svc.Name) started." "SUCCESS"
76
- }
+ $finalStatus = Get-Service -Name $svc.Name -ErrorAction SilentlyContinue
77
+ if (-not $finalStatus -or $finalStatus.Status -ne 'Running') {
78
+ throw "Service $($svc.Name) did not start within ${TimeoutSeconds}s (state: $($finalStatus.Status))."
79
+ }
80
+
81
+ Write-Log "$($svc.Name) started in $([math]::Round($stopwatch.Elapsed.TotalSeconds, 1))s." "SUCCESS"
82
83
84
# -- Database backup ----------------------------------------------------------
0 commit comments