Refactor indexer scheduling to avoid accumulating identical tasks

This commit is contained in:
Mononaut committed 2023-11-14 06:30:22 +00:00
1 parent ab8b557e73
commit 00887bc24b
3 files changed
+71 -35

No files matched your search

+1 -3
View File
@@ -776,9 +776,7 @@ class Blocks {
this.updateTimerProgress(timer, `saved prices for ${this.currentBlockHeight}`);
} else {
logger.debug(`Cannot save block price for ${blockExtended.height} because the price updater hasnt completed yet. Trying again in 10 seconds.`, logger.tags.mining);
setTimeout(() => {
indexer.runSingleTask('blocksPrices');
}, 10000);
indexer.scheduleSingleTask('blocksPrices', 10000);
}
// Save blocks summary for visualization if it's enabled