Update price at least every hour

This commit is contained in:
softsimon
2023-07-30 16:35:37 +09:00
parent af4d0b4d3f
commit 284d39baa8

View File

@@ -108,8 +108,8 @@ class PriceUpdater {
this.lastRun = await PricesRepository.$getLatestPriceTime(); this.lastRun = await PricesRepository.$getLatestPriceTime();
} }
if ((Math.round(new Date().getTime() / 1000) - this.lastRun) < config.MEMPOOL.PRICE_UPDATE_FREQUENCY) { if ((Math.round(new Date().getTime() / 1000) - this.lastRun) < Math.min(config.MEMPOOL.PRICE_UPDATE_FREQUENCY, 3600)) {
// Refresh every PRICE_UPDATE_FREQUENCY seconds at most // Refresh at least every hour or PRICE_UPDATE_FREQUENCY seconds
return; return;
} }