Truncate hashrates after #1435 - Fix hashrate indexing logs

This commit is contained in:
nymkappa
2022-03-24 07:40:03 +09:00
parent 23c02e92ea
commit 2d8a8ae4a1
2 changed files with 8 additions and 3 deletions

View File

@@ -154,7 +154,7 @@ class Mining {
await HashratesRepository.$saveHashrates(hashrates);
hashrates.length = 0;
const elapsedSeconds = Math.max(1, Math.round((new Date().getTime()) - startedAt));
const elapsedSeconds = Math.max(1, Math.round((new Date().getTime()) - startedAt)) / 1000;
if (elapsedSeconds > 1) {
const weeksPerSeconds = (indexedThisRun / elapsedSeconds).toFixed(2);
const formattedDate = new Date(fromTimestamp).toUTCString();
@@ -244,7 +244,7 @@ class Mining {
hashrates.length = 0;
}
const elapsedSeconds = Math.max(1, Math.round(new Date().getTime() - startedAt));
const elapsedSeconds = Math.max(1, Math.round(new Date().getTime() - startedAt)) / 1000;
if (elapsedSeconds > 1) {
const daysPerSeconds = (indexedThisRun / elapsedSeconds).toFixed(2);
const formattedDate = new Date(fromTimestamp).toUTCString();