diff --git a/src/integration/exchange/services/exchange-tx.service.ts b/src/integration/exchange/services/exchange-tx.service.ts index 5b01296abd..84ca48897e 100644 --- a/src/integration/exchange/services/exchange-tx.service.ts +++ b/src/integration/exchange/services/exchange-tx.service.ts @@ -12,7 +12,7 @@ import { PriceValidity, PricingService, } from 'src/subdomains/supporting/pricing/services/pricing.service'; -import { FindOptionsRelations, In, LessThan, MoreThan, MoreThanOrEqual } from 'typeorm'; +import { FindOptionsRelations, In, MoreThan, MoreThanOrEqual } from 'typeorm'; import { ExchangeTxDto } from '../dto/exchange-tx.dto'; import { ExchangeSync, ExchangeSyncs, ExchangeTx, ExchangeTxType } from '../entities/exchange-tx.entity'; import { ExchangeName } from '../enums/exchange.enum'; @@ -42,24 +42,6 @@ export class ExchangeTxService { await this.syncExchanges(); } - @DfxCron(CronExpression.EVERY_HOUR, { process: Process.EXCHANGE_TX_SYNC, timeout: 300 }) - async cleanupStalePendingDeposits() { - const staleDeposits = await this.exchangeTxRepo.find({ - where: { - type: ExchangeTxType.DEPOSIT, - status: 'pending', - created: LessThan(Util.daysBefore(1)), - }, - }); - - if (staleDeposits.length === 0) return; - - await this.exchangeTxRepo.update( - staleDeposits.map((d) => d.id), - { status: 'failed' }, - ); - } - async syncExchanges(from?: Date, exchange?: ExchangeName) { const syncs = ExchangeSyncs.filter((s) => !exchange || s.exchange === exchange); diff --git a/src/subdomains/supporting/fiat-output/fiat-output-job.service.ts b/src/subdomains/supporting/fiat-output/fiat-output-job.service.ts index 7fd45dc5b5..e2f85eb799 100644 --- a/src/subdomains/supporting/fiat-output/fiat-output-job.service.ts +++ b/src/subdomains/supporting/fiat-output/fiat-output-job.service.ts @@ -430,8 +430,6 @@ export class FiatOutputJobService { isApprovedDate: new Date(), ...(entity.info?.startsWith('YAPEAL error') && { info: null }), }); - - await this.notifyScryptDepositIfApplicable(entity); } catch (e) { this.logger.error(`Failed to transmit YAPEAL payment for fiat output ${entity.id}:`, e); @@ -491,8 +489,6 @@ export class FiatOutputJobService { remittanceInfo, ...(entity.info?.startsWith('OLKYPAY error') && { info: null }), }); - - await this.notifyScryptDepositIfApplicable(entity); } catch (e) { this.logger.error(`Failed to transmit OLKYPAY payment for fiat output ${entity.id}:`, e); @@ -533,6 +529,8 @@ export class FiatOutputJobService { await this.fiatOutputRepo.update(entity.id, updateData); + await this.notifyScryptDepositIfApplicable(entity); + if (entity.type === FiatOutputType.BANK_TX_RETURN) await this.bankTxReturnService.updateInternal(entity.bankTxReturn, { chargebackBankTx: bankTx });