few optimizations

This commit is contained in:
Ben Wilson
2023-12-07 09:07:37 -05:00
parent 893c7c2003
commit eb5d434157
2 changed files with 9 additions and 7 deletions
+7 -7
View File
@@ -44,17 +44,17 @@ export class AppController {
public async infoChart() {
// const CACHE_KEY = 'SITE_HASHRATE_GRAPH';
// const cachedResult = await this.cacheManager.get(CACHE_KEY);
const CACHE_KEY = 'SITE_HASHRATE_GRAPH';
const cachedResult = await this.cacheManager.get(CACHE_KEY);
// if (cachedResult != null) {
// return cachedResult;
// }
if (cachedResult != null) {
return cachedResult;
}
const chartData = await this.clientStatisticsService.getChartDataForSite();
//5 min
//await this.cacheManager.set(CACHE_KEY, chartData, 5 * 60 * 1000);
//10 min
await this.cacheManager.set(CACHE_KEY, chartData, 10 * 60 * 1000);
return chartData;