Refresh hooks when refreshing extensions. (#14918)

This commit is contained in:
Tommaso Sciortino
2025-12-12 16:43:46 -08:00
committed by GitHub
parent 977248e095
commit 126c32aca4
9 changed files with 26 additions and 107 deletions

View File

@@ -24,7 +24,6 @@ export class HookSystem {
private readonly hookAggregator: HookAggregator;
private readonly hookPlanner: HookPlanner;
private readonly hookEventHandler: HookEventHandler;
private initialized = false;
constructor(config: Config) {
const logger: Logger = logs.getLogger(SERVICE_NAME);
@@ -49,12 +48,7 @@ export class HookSystem {
* Initialize the hook system
*/
async initialize(): Promise<void> {
if (this.initialized) {
return;
}
await this.hookRegistry.initialize();
this.initialized = true;
debugLogger.debug('Hook system initialized successfully');
}
@@ -62,9 +56,6 @@ export class HookSystem {
* Get the hook event bus for firing events
*/
getEventHandler(): HookEventHandler {
if (!this.initialized) {
throw new Error('Hook system not initialized');
}
return this.hookEventHandler;
}
@@ -88,19 +79,4 @@ export class HookSystem {
getAllHooks(): HookRegistryEntry[] {
return this.hookRegistry.getAllHooks();
}
/**
* Get hook system status for debugging
*/
getStatus(): {
initialized: boolean;
totalHooks: number;
} {
const allHooks = this.initialized ? this.hookRegistry.getAllHooks() : [];
return {
initialized: this.initialized,
totalHooks: allHooks.length,
};
}
}