mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-21 20:30:47 +02:00
implement six-skill gstack 2 runtime
This commit is contained in:
@@ -421,14 +421,17 @@ export async function handleMetaCommand(
|
||||
}
|
||||
|
||||
case 'stop': {
|
||||
await shutdown();
|
||||
// Return the acknowledgement before closing the listener. Shutting down
|
||||
// inline resets the CLI's fetch, which it reasonably interprets as a
|
||||
// crash and then restarts the daemon it was asked to stop.
|
||||
setTimeout(() => { void shutdown(); }, 25).unref?.();
|
||||
return 'Server stopped';
|
||||
}
|
||||
|
||||
case 'restart': {
|
||||
// Signal that we want a restart — the CLI will detect exit and restart
|
||||
console.log('[browse] Restart requested. Exiting for CLI to restart.');
|
||||
await shutdown();
|
||||
setTimeout(() => { void shutdown(); }, 25).unref?.();
|
||||
return 'Restarting...';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user