Filter payments by attempts in PaymentsCron service
This commit is contained in:
parent
081cbb3410
commit
012563f252
@ -21,13 +21,10 @@ export class PaymentsCron {
|
|||||||
const payments = await this.paymentRepository.find({
|
const payments = await this.paymentRepository.find({
|
||||||
where: {
|
where: {
|
||||||
status: In([PaymentStatusEnum.RETRY, PaymentStatusEnum.PROCESSING]),
|
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) {
|
if (payments.length > 0) {
|
||||||
for (const payment of payments) {
|
for (const payment of payments) {
|
||||||
await this.processPaymentService.execute(payment.id);
|
await this.processPaymentService.execute(payment.id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user