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:
parent
40c78a471d
commit
af896db36c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue