Merge pull request #1038 from nymkappa/feature/increase-resolution-24h

Switch the 24h chart to 1 min data ticks
This commit is contained in:
wiz 2021-12-22 18:33:32 +00:00 committed by GitHub
commit 3dc0dc13ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -394,7 +394,7 @@ class Statistics {
public async $list24H(): Promise<OptimizedStatistic[]> {
try {
const connection = await DB.pool.getConnection();
const query = this.getQueryForDaysAvg(120, '1 DAY'); // 2m interval
const query = `SELECT *, UNIX_TIMESTAMP(added) as added FROM statistics ORDER BY id DESC LIMIT 1440`;
const [rows] = await connection.query<any>({ sql: query, timeout: this.queryTimeout });
connection.release();
return this.mapStatisticToOptimizedStatistic(rows);