From 4d10a476f10d515271f5aa688515b6b4f5696985 Mon Sep 17 00:00:00 2001 From: natsoni Date: Fri, 13 Feb 2026 11:08:15 +0100 Subject: [PATCH] Trigger hashrate weekly reindexing when mining pools are updated --- backend/src/api/mining/mining.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/api/mining/mining.ts b/backend/src/api/mining/mining.ts index 386f22c17..d3fadbcce 100644 --- a/backend/src/api/mining/mining.ts +++ b/backend/src/api/mining/mining.ts @@ -218,7 +218,7 @@ class Mining { const now = new Date(); // Run only if: - // * this.lastWeeklyHashrateIndexingDate is set to null (node backend restart, reorg) + // * this.lastWeeklyHashrateIndexingDate is set to null (node backend restart, reorg, or re-indexing was requested after mining pools update) // * we started a new week (around Monday midnight) const runIndexing = this.lastWeeklyHashrateIndexingDate === null || now.getUTCDay() === 1 && this.lastWeeklyHashrateIndexingDate !== now.getUTCDate(); @@ -334,6 +334,7 @@ class Mining { logger.notice(`hashrates will now be re-indexed`); await database.query(`TRUNCATE hashrates`); this.lastHashrateIndexingDate = 0; + this.lastWeeklyHashrateIndexingDate = null; this.reindexHashrateRequested = false; }