From 12f368ca6d36aca5d4111e1e2eb300e5998e1b67 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Tue, 28 Jan 2025 13:49:50 +0100 Subject: [PATCH] [indexing] initialize `currentSha` before hiting github --- backend/src/tasks/pools-updater.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/tasks/pools-updater.ts b/backend/src/tasks/pools-updater.ts index 8a1a779a1..6b0520dfc 100644 --- a/backend/src/tasks/pools-updater.ts +++ b/backend/src/tasks/pools-updater.ts @@ -45,15 +45,15 @@ class PoolsUpdater { this.lastRun = now; try { + if (config.DATABASE.ENABLED === true) { + this.currentSha = await this.getShaFromDb(); + } + const githubSha = await this.fetchPoolsSha(); // Fetch pools-v2.json sha from github if (githubSha === null) { return; } - if (config.DATABASE.ENABLED === true) { - this.currentSha = await this.getShaFromDb(); - } - logger.debug(`pools-v2.json sha | Current: ${this.currentSha} | Github: ${githubSha}`, this.tag); if (this.currentSha !== null && this.currentSha === githubSha) { return;