mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
chore: update .gitignore and improve cleanup handling in scripts
- Added .claude/hans/ to .gitignore to prevent tracking of specific directory. - Updated cleanup calls in dev.mjs and start.mjs to use await for proper asynchronous handling. - Enhanced error handling during cleanup in case of failures. - Improved server failure handling in startServerAndWait function to ensure proper termination of failed processes.
This commit is contained in:
@@ -610,6 +610,25 @@ export async function startServerAndWait({ serverPort, corsOriginEnv, npmArgs, c
|
||||
if (!serverReady) {
|
||||
log('Error: Server failed to start', 'red');
|
||||
console.log('Check logs/server.log for details');
|
||||
|
||||
// Clean up the spawned server process that failed health check
|
||||
if (serverProcess && !serverProcess.killed && serverProcess.pid) {
|
||||
log('Terminating failed server process...', 'yellow');
|
||||
try {
|
||||
await killProcessTree(serverProcess.pid);
|
||||
} catch (killErr) {
|
||||
// Fallback: try direct kill if tree-kill fails
|
||||
try {
|
||||
serverProcess.kill('SIGKILL');
|
||||
} catch {
|
||||
// Process may have already exited
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close the log stream
|
||||
logStream.end();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user