Optimize statistics.

This commit is contained in:
Simon Lindh
2020-02-17 00:26:57 +07:00
committed by wiz
parent ac95c09ea6
commit acd658a0e7
11 changed files with 148 additions and 99 deletions

View File

@@ -16,6 +16,7 @@ class Routes {
this.cache['1m'] = await statistics.$list1M();
this.cache['3m'] = await statistics.$list3M();
this.cache['6m'] = await statistics.$list6M();
this.cache['1y'] = await statistics.$list1Y();
console.log('Statistics cache created');
}
@@ -44,6 +45,10 @@ class Routes {
res.send(this.cache['6m']);
}
public get1YStatistics(req, res) {
res.send(this.cache['1y']);
}
public async getRecommendedFees(req, res) {
const result = feeApi.getRecommendedFee();
res.send(result);