mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix: app's afterLoad event wasn't triggered after installation (#5506)
* fix: hooks true * fix: error
This commit is contained in:
parent
eb6dc302ea
commit
3407c89ee6
@ -566,6 +566,10 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.cacheManager) {
|
||||||
|
await this.cacheManager.close();
|
||||||
|
}
|
||||||
|
|
||||||
this._cacheManager = await createCacheManager(this, this.options.cacheManager);
|
this._cacheManager = await createCacheManager(this, this.options.cacheManager);
|
||||||
|
|
||||||
this.log.debug('init plugins');
|
this.log.debug('init plugins');
|
||||||
@ -582,10 +586,12 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
|
|||||||
|
|
||||||
// Telemetry is initialized after beforeLoad hook
|
// Telemetry is initialized after beforeLoad hook
|
||||||
// since some configuration may be registered in beforeLoad hook
|
// since some configuration may be registered in beforeLoad hook
|
||||||
this.telemetry.init();
|
if (!this.telemetry.started) {
|
||||||
if (this.options.telemetry?.enabled) {
|
this.telemetry.init();
|
||||||
// Start collecting telemetry data if enabled
|
if (this.options.telemetry?.enabled) {
|
||||||
this.telemetry.start();
|
// Start collecting telemetry data if enabled
|
||||||
|
this.telemetry.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.pm.load(options);
|
await this.pm.load(options);
|
||||||
@ -915,7 +921,7 @@ export class Application<StateT = DefaultState, ContextT = DefaultContext> exten
|
|||||||
await this.reInit();
|
await this.reInit();
|
||||||
await this.db.sync();
|
await this.db.sync();
|
||||||
await this.load({ hooks: false });
|
await this.load({ hooks: false });
|
||||||
|
this._loaded = false;
|
||||||
this.log.debug('emit beforeInstall', { method: 'install' });
|
this.log.debug('emit beforeInstall', { method: 'install' });
|
||||||
this.setMaintainingMessage('call beforeInstall hook...');
|
this.setMaintainingMessage('call beforeInstall hook...');
|
||||||
await this.emitAsync('beforeInstall', this, options);
|
await this.emitAsync('beforeInstall', this, options);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user