This commit is contained in:
Rizky 2024-08-19 20:46:57 +07:00
parent 72c9212d9e
commit 1011d293b8
2 changed files with 10 additions and 1 deletions

View File

@ -30,6 +30,15 @@ if (!(await existsAsync(dir("app")))) {
await dirAsync(dir("app")); await dirAsync(dir("app"));
} }
process.on("message", (message) => {
if (message === "kill") {
if (g.server) {
g.server.stop(true);
process.exit();
}
}
});
if (!(await existsAsync(dir("app/db")))) { if (!(await existsAsync(dir("app/db")))) {
await $`unzip -o pkgs/zip/dbzip -d app`; await $`unzip -o pkgs/zip/dbzip -d app`;
} }

View File

@ -47,7 +47,7 @@ const startMain = (argv?: string) => {
ipc(message, subprocess) { ipc(message, subprocess) {
if (message === "restart") { if (message === "restart") {
setTimeout(() => { setTimeout(() => {
subprocess.kill(); subprocess.send("kill");
}, 5000); }, 5000);
main.process = startMain("skip_types"); main.process = startMain("skip_types");
} }