launch error display
This commit is contained in:
@@ -224,8 +224,24 @@ function Get-PendingCommands {
|
||||
# endregion
|
||||
|
||||
try {
|
||||
# Check if metadata already exists with a ControllerPid (set by ensureScript)
|
||||
$existingControllerPid = $null
|
||||
if (Test-Path $metaPath) {
|
||||
try {
|
||||
$existing = Get-Content $metaPath -Raw | ConvertFrom-Json
|
||||
if ($existing.ControllerPid) {
|
||||
$existingControllerPid = $existing.ControllerPid
|
||||
}
|
||||
} catch {
|
||||
# Ignore parse errors
|
||||
}
|
||||
}
|
||||
|
||||
# Use existing ControllerPid if available, otherwise use current PID
|
||||
$controllerPidToUse = if ($existingControllerPid) { $existingControllerPid } else { $PID }
|
||||
|
||||
# record initial state before launching worker
|
||||
Write-Metadata -Status 'initializing' -WorkerPid $null -ControllerPid $PID -Restarts 0
|
||||
Write-Metadata -Status 'initializing' -WorkerPid $null -ControllerPid $controllerPidToUse -Restarts 0
|
||||
|
||||
$resolvedPayloadBase64 = Resolve-PayloadBase64
|
||||
$PayloadBase64 = $resolvedPayloadBase64
|
||||
|
||||
Reference in New Issue
Block a user