如果是单例插件,不再初始化

This commit is contained in:
cool 2024-04-26 10:54:48 +08:00
parent 985146d401
commit 545942ea25

View File

@ -149,11 +149,11 @@ export class PluginService extends BaseService {
instance = this.pluginCenterService.plugins.get(key); instance = this.pluginCenterService.plugins.get(key);
} else { } else {
instance = new (await this.pluginCenterService.plugins.get(key))(); instance = new (await this.pluginCenterService.plugins.get(key))();
await instance.init(pluginInfo, this.ctx, this.app, {
cache: this.midwayCache,
pluginService: this,
});
} }
await instance.init(pluginInfo, this.ctx, this.app, {
cache: this.midwayCache,
pluginService: this,
});
return instance; return instance;
} }