fix
This commit is contained in:
parent
13c691a286
commit
69d2a57d07
|
|
@ -44,6 +44,9 @@ const startMain = () => {
|
|||
|
||||
const worker = new Worker("pkgs/index.ts");
|
||||
worker.onmessage = (event) => {
|
||||
if (event.data === "terminate") {
|
||||
worker.terminate();
|
||||
}
|
||||
if (event.data === "restart") {
|
||||
main.old = main.process;
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ export const createServer = async () => {
|
|||
} catch (e) {
|
||||
g.log.warn(
|
||||
`Failed to import app/srv/api${importPath.substring(
|
||||
(root || path).length,
|
||||
)}`,
|
||||
(root || path).length
|
||||
)}`
|
||||
);
|
||||
|
||||
const f = file(importPath);
|
||||
|
|
@ -67,7 +67,7 @@ export const createServer = async () => {
|
|||
addEventListener("message", (e) => {
|
||||
if (e.data === "stop-server") {
|
||||
g.server.stop();
|
||||
process.exit();
|
||||
postMessage("terminate");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue