-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Location:
api-gateway
Description:
Manual while(true) polling is used instead of a dedicated queue worker.
A proper queue library (e.g., bullmq, already in dependencies) handles concurrency, backoff, and error handling much more robustly.
Problem:
- Manual loops can cause CPU spikes if not handled correctly
- Error handling and retries are harder to manage
- Concurrency control is missing
Proposed Solution:
- Refactor
consumer.tsto use a robust worker pattern - Alternatively, ensure the manual loop has proper flow control, backoff, and error handling
// Example: Using a BullMQ worker instead of manual while(true)
import { Worker } from 'bullmq';
const myWorker = new Worker('queueName', async job => {
// handle job
}, {
connection: redisConnection
});Reactions are currently unavailable