fix: Disable EventEmitter maxListeners warning for SSE subscriptions
Each SSE client registers a listener per event type (30+ types), so a few concurrent connections easily exceed the previous limit of 100. Listeners are properly cleaned up on disconnect via eventBusIterable's finally block, so this is not a real leak.
This commit is contained in:
@@ -22,8 +22,9 @@ export class EventEmitterBus implements EventBus {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.emitter = new EventEmitter();
|
this.emitter = new EventEmitter();
|
||||||
// Allow more listeners for complex systems
|
// SSE subscriptions register per-event-type listeners (30+ types × N clients).
|
||||||
this.emitter.setMaxListeners(100);
|
// Listeners are properly cleaned up on disconnect, so disable the warning.
|
||||||
|
this.emitter.setMaxListeners(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export async function createRealProviderHarness(
|
|||||||
const accountRepository = new DrizzleAccountRepository(db);
|
const accountRepository = new DrizzleAccountRepository(db);
|
||||||
const initiativeRepository = new DrizzleInitiativeRepository(db);
|
const initiativeRepository = new DrizzleInitiativeRepository(db);
|
||||||
|
|
||||||
// Create event bus with capture (parent class already sets maxListeners to 100)
|
// Create event bus with capture (parent class disables maxListeners warning)
|
||||||
const eventBus = new CapturingEventBus();
|
const eventBus = new CapturingEventBus();
|
||||||
|
|
||||||
// Create REAL agent manager (not mock!)
|
// Create REAL agent manager (not mock!)
|
||||||
|
|||||||
Reference in New Issue
Block a user