mirror of
https://github.com/certd/certd.git
synced 2026-07-24 04:27:36 +08:00
fix: 修复上传到cos报runtimeDepsService未初始化的问题
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { Config, Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { logger } from "@certd/basic";
|
||||
import { PluginService } from "../plugin/service/plugin-service.js";
|
||||
import { registerPaymentProviders } from "../suite/payments/index.js";
|
||||
import { RuntimeDepsService } from "../runtime-deps/runtime-deps-service.js";
|
||||
import { getRuntimeDepsService, initRuntimeDepsService } from "@certd/pipeline";
|
||||
import { pluginRegistry, accessRegistry, notificationRegistry } from "@certd/pipeline";
|
||||
import { dnsProviderRegistry } from "@certd/plugin-lib";
|
||||
import { addonRegistry } from "@certd/lib-server";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@@ -10,8 +13,8 @@ export class AutoLoadPlugins {
|
||||
@Inject()
|
||||
pluginService: PluginService;
|
||||
|
||||
@Inject()
|
||||
runtimeDepsService: RuntimeDepsService;
|
||||
@Config('runtimeDeps')
|
||||
runtimeDepsConfig: any;
|
||||
|
||||
async init() {
|
||||
logger.info(`加载插件开始,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
@@ -31,11 +34,23 @@ export class AutoLoadPlugins {
|
||||
}
|
||||
// await import("../../plugins/index.js")
|
||||
await this.pluginService.registerFromDb();
|
||||
|
||||
|
||||
await registerPaymentProviders();
|
||||
logger.info(`加载插件完成,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
|
||||
//初始化第三方依赖服务
|
||||
initRuntimeDepsService(this.runtimeDepsConfig,{
|
||||
pluginRegistry,
|
||||
accessRegistry,
|
||||
notificationRegistry,
|
||||
dnsProviderRegistry,
|
||||
addonRegistry,
|
||||
});
|
||||
// 收集插件 dependPackages 并安装
|
||||
await this.runtimeDepsService.refreshPluginDeps();
|
||||
const service = getRuntimeDepsService();
|
||||
service.refreshPluginDeps();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user