Reduce DB pool size, payment concurrency, and job attempts

This commit is contained in:
Jose Eduardo 2025-08-17 15:23:35 -04:00
parent a929d89fb3
commit f55ea5b731
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ import { Payment } from '../payments/entities/payment.entity';
database: configService.get('database.database'),
entities: [Payment],
extra: {
max: 10,
max: 5,
// connectionTimeoutMillis: 3000,
},
synchronize: false,

View File

@ -8,7 +8,7 @@ import { Payment } from '../entities/payment.entity';
import { Repository } from 'typeorm';
import { CreatePaymentDto } from '../dto/create-payment.dto';
@Processor(PAYMENT_QUEUE, { concurrency: 10 })
@Processor(PAYMENT_QUEUE, { concurrency: 5 })
@Injectable()
export class PaymentProcessor extends WorkerHost {
private readonly logger = new Logger(PaymentProcessor.name);

View File

@ -11,7 +11,7 @@ export class QueueService {
async addPaymentJob(data: CreatePaymentDto): Promise<void> {
await this.paymentQueue.add(PAYMENT_QUEUE, data, {
jobId: data.correlationId,
attempts: 100,
attempts: 90,
backoff: {
type: 'exponential',
delay: 100,