fix(mpc-service): don't block HTTP server startup during Kafka rebalance

This commit is contained in:
hailin 2025-12-09 03:31:26 -08:00
parent 0546cff708
commit 6ab3f92813
1 changed files with 5 additions and 6 deletions

View File

@ -14,12 +14,11 @@ export class EventConsumerStarterService implements OnApplicationBootstrap {
constructor(private readonly eventConsumer: EventConsumerService) {}
async onApplicationBootstrap() {
try {
await this.eventConsumer.startConsuming();
this.logger.log('MPC event consumers started successfully');
} catch (error) {
onApplicationBootstrap() {
// Don't await - let HTTP server start immediately while Kafka rebalances in background
this.eventConsumer.startConsuming().catch((error) => {
this.logger.error('Failed to start MPC event consumers', error);
}
});
this.logger.log('MPC event consumers starting in background');
}
}