@geekbeer/minion 2.68.2 → 2.68.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@ function buildGracefulStopBlock(agentPort, apiToken) {
|
|
|
69
69
|
return [
|
|
70
70
|
` try {`,
|
|
71
71
|
` Invoke-RestMethod -Uri 'http://localhost:${agentPort}/api/shutdown' -Method POST ` +
|
|
72
|
-
`-Headers @{ Authorization = 'Bearer ${apiToken}' } -TimeoutSec 5 | Out-Null`,
|
|
72
|
+
`-ContentType 'application/json' -Headers @{ Authorization = 'Bearer ${apiToken}' } -TimeoutSec 5 | Out-Null`,
|
|
73
73
|
` Log 'Graceful shutdown requested, waiting for offline heartbeat...'`,
|
|
74
74
|
` Start-Sleep -Seconds 4`,
|
|
75
75
|
` } catch {`,
|
package/win/minion-cli.ps1
CHANGED
|
@@ -206,7 +206,7 @@ function Stop-MinionProcess {
|
|
|
206
206
|
try {
|
|
207
207
|
$headers = @{}
|
|
208
208
|
if ($token) { $headers['Authorization'] = "Bearer $token" }
|
|
209
|
-
Invoke-RestMethod -Uri "$AgentUrl/api/shutdown" -Method POST -Headers $headers -TimeoutSec 5 | Out-Null
|
|
209
|
+
Invoke-RestMethod -Uri "$AgentUrl/api/shutdown" -Method POST -ContentType 'application/json' -Headers $headers -TimeoutSec 5 | Out-Null
|
|
210
210
|
Write-Host "Graceful shutdown requested, waiting..."
|
|
211
211
|
Start-Sleep -Seconds 4
|
|
212
212
|
} catch {
|
package/win/routes/commands.js
CHANGED
|
@@ -68,10 +68,11 @@ async function commandRoutes(fastify) {
|
|
|
68
68
|
const [cmd, args] = allowedCommand.spawnArgs
|
|
69
69
|
spawnLog(`[${command}] spawn: ${cmd} ${JSON.stringify(args)}`)
|
|
70
70
|
try {
|
|
71
|
+
const stderrPath = path.join(os.homedir(), '.minion', `${command}-stderr.log`)
|
|
72
|
+
const stderrFd = fs.openSync(stderrPath, 'w')
|
|
71
73
|
const child = spawn(cmd, args, {
|
|
72
74
|
detached: true,
|
|
73
|
-
stdio: 'ignore',
|
|
74
|
-
windowsHide: true,
|
|
75
|
+
stdio: ['ignore', 'ignore', stderrFd],
|
|
75
76
|
})
|
|
76
77
|
child.on('error', (err) => {
|
|
77
78
|
spawnLog(`[${command}] child error: ${err.message}`)
|