mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
Revert "Fix home graph hashrate calculation (around restarts)"
This reverts commit 220a1d1558.
This commit is contained in:
@@ -68,21 +68,16 @@ export class AppService implements OnModuleInit {
|
|||||||
console.log('Updating Chart');
|
console.log('Updating Chart');
|
||||||
|
|
||||||
const latestGraphUpdate = await this.homeGraphService.getLatestTime();
|
const latestGraphUpdate = await this.homeGraphService.getLatestTime();
|
||||||
const latestGraphUpdateMilliseconds = latestGraphUpdate.getTime();
|
|
||||||
|
|
||||||
const now = new Date();
|
|
||||||
const diffInMilliseconds = now.getTime() - latestGraphUpdateMilliseconds;
|
|
||||||
const latestGraphUpdateSeconds = Math.floor(diffInMilliseconds / 1000); // Convert milliseconds to seconds
|
|
||||||
|
|
||||||
|
|
||||||
const data = await this.dataSource.query(`
|
const data = await this.dataSource.query(`
|
||||||
SELECT
|
SELECT
|
||||||
time AS label,
|
time AS label,
|
||||||
ROUND(((SUM(shares) * 4294967296) / ${latestGraphUpdateSeconds})) AS data
|
ROUND(((SUM(shares) * 4294967296) / 600)) AS data
|
||||||
FROM
|
FROM
|
||||||
client_statistics_entity AS entry
|
client_statistics_entity AS entry
|
||||||
WHERE
|
WHERE
|
||||||
entry.time > ${latestGraphUpdateMilliseconds}
|
entry.time > ${latestGraphUpdate.getTime()}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
time
|
time
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|||||||
Reference in New Issue
Block a user