mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-10 04:09:40 +00:00
fix(sprite): add 60s timeout to destroyServer to prevent hanging (#2096)
The sprite destroy command can hang indefinitely when the Sprite API is unresponsive. Add a 60s timeout using the existing killWithTimeout utility (same pattern as runSprite). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: L <6723574+louisgv@users.noreply.github.com> Co-authored-by: A <258483684+la14-1@users.noreply.github.com>
This commit is contained in:
parent
3911b5bc28
commit
297e7ff21c
1 changed files with 3 additions and 0 deletions
|
|
@ -642,7 +642,10 @@ export async function destroyServer(name?: string): Promise<void> {
|
|||
);
|
||||
// Drain stderr before awaiting exit to prevent pipe buffer deadlock
|
||||
const stderrText = new Response(proc.stderr).text();
|
||||
// 60s timeout — sprite destroy should not hang indefinitely
|
||||
const timer = setTimeout(() => killWithTimeout(proc), 60_000);
|
||||
const exitCode = await proc.exited;
|
||||
clearTimeout(timer);
|
||||
if (exitCode !== 0) {
|
||||
logError(`Failed to destroy sprite '${target}'`);
|
||||
logError(`Delete it manually: sprite destroy ${target}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue