Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions src/integration/exchange/services/exchange-tx.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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 });

Expand Down
Loading