mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): add local CloudCode proxy sync and independent Main/Subagent-Swarm context window toggles (#36)
This commit is contained in:
@@ -242,5 +242,28 @@ if (isTestHarnessEnv) {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
let processStopping = false;
|
||||
async function handleProcessExitSignal(exitCode = 0) {
|
||||
if (processStopping) return;
|
||||
processStopping = true;
|
||||
const forceTimer = setTimeout(() => process.exit(exitCode), 1800);
|
||||
forceTimer.unref?.();
|
||||
try {
|
||||
if (activeWorker) {
|
||||
const w = activeWorker;
|
||||
activeWorker = null;
|
||||
await stopWorkerGracefully(w);
|
||||
}
|
||||
} finally {
|
||||
clearTimeout(forceTimer);
|
||||
process.exit(exitCode);
|
||||
}
|
||||
}
|
||||
process.once('SIGTERM', () => {
|
||||
void handleProcessExitSignal(0);
|
||||
});
|
||||
process.once('SIGINT', () => {
|
||||
void handleProcessExitSignal(0);
|
||||
});
|
||||
void ensureActiveWorker();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user