mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
update interface: ProblemConfig
This commit is contained in:
1 parent
92335d8529
commit
57881792f3
15 files changed
+226
-145
No files matched your search
+6
-1
@@ -10,6 +10,8 @@ import fs from 'fs-extra';
|
||||
import { argv } from 'yargs';
|
||||
import AdmZip from 'adm-zip';
|
||||
|
||||
export * from './interface';
|
||||
|
||||
global.Hydro = {
|
||||
stat: { reqCount: 0 },
|
||||
handler: {},
|
||||
@@ -65,7 +67,10 @@ async function entry(config: EntryConfig) {
|
||||
const sargv = [`--entry=${config.entry}`];
|
||||
const p = await fork(sargv);
|
||||
await new Promise((resolve, reject) => {
|
||||
p.on('exit', resolve);
|
||||
p.on('exit', (code, signal) => {
|
||||
if (code === 0) resolve();
|
||||
else reject(signal);
|
||||
});
|
||||
p.on('error', (err: Error) => {
|
||||
p.kill();
|
||||
reject(err);
|
||||
|
||||
Reference in new issue
Block a user