fix price updater loop on testnet/signet

This commit is contained in:
Mononaut 2023-07-11 16:03:44 +09:00
parent 795e6753eb
commit ca2830d6d8
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -6,6 +6,7 @@ import logger from './logger';
import bitcoinClient from './api/bitcoin/bitcoin-client'; import bitcoinClient from './api/bitcoin/bitcoin-client';
import priceUpdater from './tasks/price-updater'; import priceUpdater from './tasks/price-updater';
import PricesRepository from './repositories/PricesRepository'; import PricesRepository from './repositories/PricesRepository';
import config from './config';
export interface CoreIndex { export interface CoreIndex {
name: string; name: string;
@ -72,7 +73,7 @@ class Indexer {
return; return;
} }
if (task === 'blocksPrices' && !this.tasksRunning.includes(task)) { if (task === 'blocksPrices' && !this.tasksRunning.includes(task) && !['testnet', 'signet'].includes(config.MEMPOOL.NETWORK)) {
this.tasksRunning.push(task); this.tasksRunning.push(task);
const lastestPriceId = await PricesRepository.$getLatestPriceId(); const lastestPriceId = await PricesRepository.$getLatestPriceId();
if (priceUpdater.historyInserted === false || lastestPriceId === null) { if (priceUpdater.historyInserted === false || lastestPriceId === null) {