This commit is contained in:
@@ -21,4 +21,20 @@ try {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`gpu-doctor: ${error.message}`);
|
console.error(`gpu-doctor: ${error.message}`);
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
|
} finally {
|
||||||
|
// Resource discovery initializes QVAC handles even without loading a model.
|
||||||
|
// This one-shot command owns them and must close them before returning to
|
||||||
|
// first-run. Bound cleanup in case a native handle never settles.
|
||||||
|
const watchdog = setTimeout(() => {
|
||||||
|
console.error('gpu-doctor: QVAC cleanup timed out');
|
||||||
|
process.exit(1);
|
||||||
|
}, 5000);
|
||||||
|
try {
|
||||||
|
await Agent.engine.close();
|
||||||
|
} finally {
|
||||||
|
clearTimeout(watchdog);
|
||||||
|
}
|
||||||
|
// Bare addons may retain handles after close; this diagnostic has no more
|
||||||
|
// work to do. Never put this exit in the shared daemon/runtime lifecycle.
|
||||||
|
if (globalThis.Bare) Bare.exit(process.exitCode || 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user