work on ceo
This commit is contained in:
parent
c8dcd697c9
commit
b25222778e
18 changed files with 391 additions and 110 deletions
|
|
@ -76,7 +76,7 @@
|
|||
"delay": 1000
|
||||
},
|
||||
"removeOnComplete": 100,
|
||||
"removeOnFail": 50
|
||||
"removeOnFail": 100
|
||||
}
|
||||
},
|
||||
"http": {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
"defaultJobOptions": {
|
||||
"attempts": 1,
|
||||
"removeOnComplete": 100,
|
||||
"removeOnFail": 50
|
||||
"removeOnFail": 100
|
||||
}
|
||||
},
|
||||
"http": {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export const queueConfigSchema = z.object({
|
|||
})
|
||||
.default({}),
|
||||
removeOnComplete: z.number().default(100),
|
||||
removeOnFail: z.number().default(50),
|
||||
removeOnFail: z.number().default(100),
|
||||
timeout: z.number().optional(),
|
||||
})
|
||||
.default({}),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export const queueConfigSchema = z.object({
|
|||
})
|
||||
.default({}),
|
||||
removeOnComplete: z.number().default(100),
|
||||
removeOnFail: z.number().default(50),
|
||||
removeOnFail: z.number().default(100),
|
||||
timeout: z.number().optional(),
|
||||
})
|
||||
.optional()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { asClass, asFunction, createContainer, InjectionMode, type AwilixContainer } from 'awilix';
|
||||
import type { BaseAppConfig as StockBotAppConfig, UnifiedAppConfig } from '@stock-bot/config';
|
||||
import { toUnifiedConfig } from '@stock-bot/config';
|
||||
import { HandlerRegistry } from '@stock-bot/handler-registry';
|
||||
import { asClass, asFunction, createContainer, InjectionMode, type AwilixContainer } from 'awilix';
|
||||
import { appConfigSchema, type AppConfig } from '../config/schemas';
|
||||
import {
|
||||
registerApplicationServices,
|
||||
|
|
@ -133,7 +133,7 @@ export class ServiceContainerBuilder {
|
|||
attempts: 3,
|
||||
backoff: { type: 'exponential' as const, delay: 1000 },
|
||||
removeOnComplete: 100,
|
||||
removeOnFail: 50,
|
||||
removeOnFail: 100,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ async function processDirect<T>(
|
|||
delay: index * delayPerItem,
|
||||
priority: options.priority || undefined,
|
||||
attempts: options.retries || 3,
|
||||
removeOnComplete: options.removeOnComplete || 10,
|
||||
removeOnFail: options.removeOnFail || 5,
|
||||
removeOnComplete: options.removeOnComplete || 100,
|
||||
removeOnFail: options.removeOnFail || 100,
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
@ -151,8 +151,8 @@ async function processBatched<T>(
|
|||
delay: batchIndex * delayPerBatch,
|
||||
priority: options.priority || undefined,
|
||||
attempts: options.retries || 3,
|
||||
removeOnComplete: options.removeOnComplete || 10,
|
||||
removeOnFail: options.removeOnFail || 5,
|
||||
removeOnComplete: options.removeOnComplete || 100,
|
||||
removeOnFail: options.removeOnFail || 100,
|
||||
},
|
||||
};
|
||||
})
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export class DeadLetterQueueHandler {
|
|||
|
||||
await this.dlq.add('failed-job', dlqData, {
|
||||
removeOnComplete: 100,
|
||||
removeOnFail: 50,
|
||||
removeOnFail: 100,
|
||||
});
|
||||
|
||||
this.logger.error('Job moved to DLQ', {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ export class Queue {
|
|||
this.bullQueue = new BullQueue(queueName, {
|
||||
connection,
|
||||
defaultJobOptions: {
|
||||
removeOnComplete: 10,
|
||||
removeOnFail: 5,
|
||||
removeOnComplete: 100,
|
||||
removeOnFail: 100,
|
||||
attempts: 3,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ describe('Batch Processor', () => {
|
|||
priority: 5,
|
||||
retries: 10,
|
||||
removeOnComplete: 100,
|
||||
removeOnFail: 50,
|
||||
removeOnFail: 100,
|
||||
});
|
||||
|
||||
// Check all states including job ID "1" specifically (as it often doesn't show up in state queries)
|
||||
|
|
@ -337,7 +337,7 @@ describe('Batch Processor', () => {
|
|||
expect(job.opts.priority).toBe(5);
|
||||
expect(job.opts.attempts).toBe(10);
|
||||
expect(job.opts.removeOnComplete).toBe(100);
|
||||
expect(job.opts.removeOnFail).toBe(50);
|
||||
expect(job.opts.removeOnFail).toBe(100);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue