updates
This commit is contained in:
parent
d3ef73ae00
commit
a2fa08de88
8 changed files with 72 additions and 68 deletions
|
|
@ -1,17 +1,10 @@
|
|||
import { Queue, type Job } from 'bullmq';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import type { JobData } from './types';
|
||||
import type { JobData, DLQConfig, RedisConfig } from './types';
|
||||
import { getRedisConnection } from './utils';
|
||||
|
||||
const logger = getLogger('dlq-handler');
|
||||
|
||||
export interface DLQConfig {
|
||||
maxRetries?: number;
|
||||
retryDelay?: number;
|
||||
alertThreshold?: number;
|
||||
cleanupAge?: number; // hours
|
||||
}
|
||||
|
||||
export class DeadLetterQueueHandler {
|
||||
private dlq: Queue;
|
||||
private config: Required<DLQConfig>;
|
||||
|
|
@ -19,7 +12,7 @@ export class DeadLetterQueueHandler {
|
|||
|
||||
constructor(
|
||||
private mainQueue: Queue,
|
||||
private connection: any,
|
||||
private connection: RedisConfig,
|
||||
config: DLQConfig = {}
|
||||
) {
|
||||
this.config = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue