mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix addon load
This commit is contained in:
1 parent
2e4c818c37
commit
92335d8529
9 files changed
+80
-38
No files matched your search
+9
-2
@@ -54,7 +54,12 @@ async function fork(args: string[] = []) {
|
||||
return cluster.fork();
|
||||
}
|
||||
|
||||
async function entry(config: any) {
|
||||
interface EntryConfig {
|
||||
entry: string,
|
||||
newProcess?: boolean,
|
||||
}
|
||||
|
||||
async function entry(config: EntryConfig) {
|
||||
if (config.entry) {
|
||||
if (config.newProcess) {
|
||||
const sargv = [`--entry=${config.entry}`];
|
||||
@@ -74,6 +79,8 @@ async function entry(config: any) {
|
||||
return null;
|
||||
}
|
||||
|
||||
export type Entry = typeof entry;
|
||||
|
||||
async function stopWorker() {
|
||||
cluster.disconnect();
|
||||
}
|
||||
@@ -201,7 +208,7 @@ export async function load() {
|
||||
console.log(global.addons);
|
||||
if (argv.entry) {
|
||||
console.log(`Worker ${process.pid} Starting as ${argv.entry}`);
|
||||
await entry({ entry: argv.entry });
|
||||
await entry({ entry: argv.entry as string });
|
||||
console.log(`Worker ${process.pid} Started as ${argv.entry}`);
|
||||
} else {
|
||||
if (argv.firstWorker) cluster.isFirstWorker = true;
|
||||
|
||||
Reference in new issue
Block a user