mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: use serviceInstance for system model
This commit is contained in:
30 files changed
+143
-104
No files matched your search
@@ -4,6 +4,7 @@ import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import { Context } from '../context';
|
||||
import { Logger } from '../logger';
|
||||
import SystemModel from '../model/system';
|
||||
import { load } from '../options';
|
||||
import { MongoService } from '../service/db';
|
||||
import { SettingService } from '../settings';
|
||||
@@ -30,10 +31,9 @@ export async function apply(ctx: Context) {
|
||||
await locale(pending, fail);
|
||||
await ctx.plugin(MongoService, load() || {});
|
||||
await ctx.plugin(SettingService);
|
||||
const modelSystem = require('../model/system');
|
||||
await modelSystem.runConfig();
|
||||
await ctx.plugin(SystemModel.Service);
|
||||
ctx = await new Promise((resolve) => {
|
||||
ctx.inject(['loader', 'setting', 'db'], (c) => {
|
||||
ctx.inject(['loader', 'setting', 'db', 'model:system'], (c) => {
|
||||
resolve(c);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user