fix: Kill nitro many times app onDispose
This commit is contained in:
parent
96fa392fba
commit
257011309f
@ -188,18 +188,15 @@ async function validateModelStatus(): Promise<ModelOperationResponse> {
|
|||||||
* @returns A Promise that resolves when the subprocess is terminated successfully, or rejects with an error message if the subprocess fails to terminate.
|
* @returns A Promise that resolves when the subprocess is terminated successfully, or rejects with an error message if the subprocess fails to terminate.
|
||||||
*/
|
*/
|
||||||
function killSubprocess(): Promise<void> {
|
function killSubprocess(): Promise<void> {
|
||||||
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();
|
||||||
|
kill(PORT, "tcp").then(console.log).catch(console.log);
|
||||||
subprocess = null;
|
subprocess = null;
|
||||||
return kill(PORT, "tcp").then(console.log).catch(console.log);
|
|
||||||
});
|
});
|
||||||
} else {
|
return
|
||||||
return kill(PORT, "tcp").then(console.log).catch(console.log);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user