fix(mpc-service): don't await consumer.run() to prevent app startup blocking

consumer.run() never resolves as it runs continuously. Awaiting it
blocks onApplicationBootstrap which prevents app.listen() from being
called, causing the service to never start listening on port 3006.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-09 03:04:48 -08:00
parent 40c78a471d
commit af896db36c
1 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,11 @@ export class EventConsumerStarterService implements OnApplicationBootstrap {
async onApplicationBootstrap() {
try {
await this.eventConsumer.startConsuming();
// Don't await - consumer.run() never resolves (it runs continuously)
// Just fire and forget, let it run in the background
this.eventConsumer.startConsuming().catch((error) => {
this.logger.error('Kafka consumer error', error);
});
this.logger.log('MPC event consumers started successfully');
} catch (error) {
this.logger.error('Failed to start MPC event consumers', error);