Skip to content

Commit 050349f

Browse files
fix: add timneout to unified consumer and update throttle map immediately in admin-alert-servuce
1 parent c175a75 commit 050349f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/admin-alerts/admin-alert.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ export class AdminAlertService {
6161
enabled: true,
6262
[filterField]: true,
6363
});
64-
64+
6565
// No channels configured - silent no-op (backwards compatible)
6666
if (channels.length === 0) {
6767
return;
6868
}
69-
69+
70+
// Update throttle timestamp
71+
throttleMap.set(alertType, Date.now());
72+
7073
// Get encryption key (auto-creates if needed)
7174
const encryptionKey = await getOrCreateEncryptionKey();
7275

@@ -101,8 +104,6 @@ export class AdminAlertService {
101104
}
102105
}
103106

104-
// Update throttle timestamp
105-
throttleMap.set(alertType, Date.now());
106107
} catch (err) {
107108
// Never throw - admin alerts are non-critical to core functionality
108109
logger.error('AdminAlertService.sendAlert failed:', err);

src/processors/unified/unified.consumer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ export const startUnifiedConsumer = async (channel: string): Promise<void> => {
374374

375375
logger.info(`[${channel}] Creating consumer for topic: ${topic}, group: ${groupId}`);
376376

377-
const consumer = kafka.consumer({ groupId });
377+
const consumer = kafka.consumer({
378+
groupId,
379+
sessionTimeout: 30000,
380+
rebalanceTimeout: 60000,
381+
heartbeatInterval: 3000,
382+
});
383+
378384
await consumer.connect();
379385
await consumer.subscribe({ topic, fromBeginning: false });
380386

0 commit comments

Comments
 (0)