Split network daily hashrate indexing and weekly pool hashrate indexing

This commit is contained in:
nymkappa
2022-03-06 12:32:16 +01:00
parent c23d3224d4
commit ce14cd2496
4 changed files with 139 additions and 46 deletions

View File

@@ -167,7 +167,8 @@ class Server {
}
async $resetHashratesIndexingState() {
return await HashratesRepository.$setLatestRunTimestamp(0);
await HashratesRepository.$setLatestRunTimestamp('last_hashrates_indexing', 0);
await HashratesRepository.$setLatestRunTimestamp('last_week_hashrates_indexing', 0);
}
async $runIndexingWhenReady() {
@@ -178,6 +179,7 @@ class Server {
try {
await blocks.$generateBlockDatabase();
await mining.$generateNetworkHashrateHistory();
await mining.$generatePoolHashrateHistory();
} catch (e) {
logger.err(`Unable to run indexing right now, trying again later. ` + e);
}