mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
加载过程优化
This commit is contained in:
1 parent
bc6426927f
commit
5db23edebb
8 files changed
+74
-58
No files matched your search
@@ -4,8 +4,8 @@ const os = require('os');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {
|
||||
lib, service, model, handler, script,
|
||||
builtinLib, builtinScript, builtinHandler, builtinModel,
|
||||
lib, service, model, config,
|
||||
builtinLib, builtinHandler, builtinModel,
|
||||
} = require('./common');
|
||||
|
||||
function ensureDir(dir) {
|
||||
@@ -67,10 +67,7 @@ async function load(call) {
|
||||
const ins = require('../script/install');
|
||||
await ins.run({ username: 'Root', password: 'rootroot' });
|
||||
}
|
||||
await handler(pending, fail);
|
||||
for (const i in global.Hydro.handler) {
|
||||
await global.Hydro.handler[i]();
|
||||
}
|
||||
await config(pending, fail);
|
||||
for (const i in global.Hydro.service) {
|
||||
if (global.Hydro.service[i].postInit) {
|
||||
try {
|
||||
@@ -80,8 +77,6 @@ async function load(call) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const i of builtinScript) require(`../script/${i}`);
|
||||
await script(pending, fail, active);
|
||||
pending = [];
|
||||
return { fail, active };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user