Update extensions/inference-nitro-extension/src/module.ts

Co-authored-by: Louis <louis@jan.ai>
This commit is contained in:
hiro 2023-12-13 16:40:56 +07:00 committed by GitHub
parent 539f11e583
commit 96fa392fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,13 +189,13 @@ async function validateModelStatus(): Promise<ModelOperationResponse> {
*/ */
function killSubprocess(): Promise<void> { function killSubprocess(): Promise<void> {
if (subprocess) { if (subprocess) {
fetch(NITRO_HTTP_KILL_URL, { return fetch(NITRO_HTTP_KILL_URL, {
method: "DELETE", method: "DELETE",
}).catch((err) => { }).catch((err) => {
console.error(err); console.error(err);
subprocess.kill(); subprocess.kill();
subprocess = null; subprocess = null;
return killSubprocess(); return kill(PORT, "tcp").then(console.log).catch(console.log);
}); });
} else { } else {
return kill(PORT, "tcp").then(console.log).catch(console.log); return kill(PORT, "tcp").then(console.log).catch(console.log);