[indexing] initialize currentSha before hiting github

This commit is contained in:
nymkappa 2025-01-28 13:49:50 +01:00
parent b5d5231bc1
commit 2b79fd438d
No known key found for this signature in database
GPG key ID: 92358FC85D9645DE

View file

@ -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;