From 012563f2529f8c36dd8880ff0aa702e67893bcc7 Mon Sep 17 00:00:00 2001 From: jos3duardo Date: Sun, 10 Aug 2025 21:03:07 -0400 Subject: [PATCH] Filter payments by attempts in PaymentsCron service --- src/modules/payments/cron/payments.cron.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/payments/cron/payments.cron.ts b/src/modules/payments/cron/payments.cron.ts index e573b54..bb5bcf6 100644 --- a/src/modules/payments/cron/payments.cron.ts +++ b/src/modules/payments/cron/payments.cron.ts @@ -21,13 +21,10 @@ export class PaymentsCron { const payments = await this.paymentRepository.find({ where: { status: In([PaymentStatusEnum.RETRY, PaymentStatusEnum.PROCESSING]), + attempts: In([1, 2, 3]), }, }); - this.logger.debug( - `Found ${payments.length} payments in processing or retry status`, - ); - if (payments.length > 0) { for (const payment of payments) { await this.processPaymentService.execute(payment.id);