mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: update hook usage
This commit is contained in:
1 parent
ab933bc9d5
commit
757b5e6bc1
27 files changed
+63
-64
No files matched your search
@@ -6,7 +6,6 @@ import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import { Context } from '../context';
|
||||
import { Logger } from '../logger';
|
||||
import * as bus from '../service/bus';
|
||||
import db from '../service/db';
|
||||
import {
|
||||
addon, handler, lib, locale, model,
|
||||
@@ -61,7 +60,7 @@ export async function apply(ctx: Context) {
|
||||
for (const i in global.Hydro.handler) await global.Hydro.handler[i]();
|
||||
require('../script/index');
|
||||
await script(pending, fail, ctx);
|
||||
await bus.serial('app/started');
|
||||
await ctx.parallel('app/started');
|
||||
if (process.env.NODE_APP_INSTANCE === '0') {
|
||||
const scripts = require('../upgrade').default;
|
||||
let dbVer = (await modelSystem.get('db.ver')) ?? 0;
|
||||
@@ -82,6 +81,6 @@ export async function apply(ctx: Context) {
|
||||
}
|
||||
logger.success('Server started');
|
||||
process.send?.('ready');
|
||||
await bus.serial('app/ready');
|
||||
await ctx.parallel('app/ready');
|
||||
return { fail };
|
||||
}
|
||||
Reference in new issue
Block a user