From 452bcd698e6b3724fb7e995bedea02447df1a77f Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Wed, 1 Apr 2026 14:02:47 +0000 Subject: [PATCH] fix(update): restart service if stopped even when no git updates Previously update.ps1 exited immediately when no updates were available, leaving the service stopped if a prior restart had failed. Co-Authored-By: Claude Opus 4.6 (1M context) --- update.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/update.ps1 b/update.ps1 index 790099d..d6cc544 100644 --- a/update.ps1 +++ b/update.ps1 @@ -45,7 +45,17 @@ $local = git rev-parse HEAD $remote = git rev-parse FETCH_HEAD if ($local -eq $remote) { - Log "Nicio actualizare disponibila." "Gray" + # Verify service is running even when no updates + $status = (nssm status GoMagVending 2>&1) -replace '\0','' + if ($status -ne 'SERVICE_RUNNING') { + Log "Nicio actualizare, dar serviciul nu ruleaza ($status). Restart..." "Yellow" + nssm restart GoMagVending 2>&1 | Out-Null + Start-Sleep -Seconds 3 + $status = (nssm status GoMagVending 2>&1) -replace '\0','' + Log "Serviciu: $status" "Green" + } else { + Log "Nicio actualizare disponibila." "Gray" + } exit 0 }