chore: clean up sub process on exit
This commit is contained in:
parent
efc6db9e1a
commit
cc898618d8
5
.gitignore
vendored
5
.gitignore
vendored
@ -13,9 +13,4 @@ build
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
electron/renderer
|
electron/renderer
|
||||||
|
|
||||||
|
|
||||||
# Nitro
|
|
||||||
electron/core/plugins/nitro-plugin/nitro
|
|
||||||
electron/core/plugins/nitro-plugin/uploads
|
|
||||||
electron/core/plugins/nitro-plugin/*.log
|
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@ -5,6 +5,14 @@ const fs = require("fs");
|
|||||||
|
|
||||||
let subprocess = null;
|
let subprocess = null;
|
||||||
|
|
||||||
|
process.on("exit", () => {
|
||||||
|
// Perform cleanup tasks here
|
||||||
|
console.log("kill subprocess on exit");
|
||||||
|
if (subprocess) {
|
||||||
|
subprocess.kill();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function initModel(product) {
|
async function initModel(product) {
|
||||||
// fileName fallback
|
// fileName fallback
|
||||||
if (!product.fileName) {
|
if (!product.fileName) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user