Filter payments by attempts in PaymentsCron service

This commit is contained in:
Jose Eduardo 2025-08-10 21:03:07 -04:00
parent 081cbb3410
commit 012563f252

View File

@ -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);