Merge pull request #3947 from mempool/mononaut/fix-testnet-price-updater

fix price updater loop on testnet/signet
This commit is contained in:
wiz 2023-07-12 16:00:39 +09:00 committed by GitHub
commit 4b9d0d1d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {