Polish mining page UI

Make sure to wait for all mining pools queries before continuing
This commit is contained in:
nymkappa committed 2022-01-28 15:01:22 +09:00
1 parent 045141d16d
commit 1160baaf02
5 files changed
+99 -50

No files matched your search

+1 -1
View File
@@ -265,7 +265,7 @@ class Server {
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/1y', routes.$getStatisticsByTime.bind(routes, '1y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/2y', routes.$getStatisticsByTime.bind(routes, '2y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'statistics/3y', routes.$getStatisticsByTime.bind(routes, '3y'))
.get(config.MEMPOOL.API_URL_PREFIX + 'pools', routes.getPools)
.get(config.MEMPOOL.API_URL_PREFIX + 'pools', routes.$getPools)
;
}
+4 -1
View File
@@ -532,9 +532,12 @@ class Routes {
}
}
public async getPools(req: Request, res: Response) {
public async $getPools(req: Request, res: Response) {
try {
let stats = await miningStats.$getPoolsStats(req.query.interval as string);
// res.header('Pragma', 'public');
// res.header('Cache-control', 'public');
// res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString());
res.json(stats);
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);