mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 09:39:17 +01:00
Base expiry on update frequency
This commit is contained in:
parent
2892bfa1d8
commit
07f95acc29
2 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ class PricesRoutes {
|
|||
private $getCurrentPrices(req: Request, res: Response): void {
|
||||
res.header('Pragma', 'public');
|
||||
res.header('Cache-control', 'public');
|
||||
res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString());
|
||||
res.setHeader('Expires', new Date(Date.now() + 360_0000 / config.MEMPOOL.PRICE_UPDATES_PER_HOUR).toUTCString());
|
||||
|
||||
res.json(pricesUpdater.getLatestPrices());
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ export interface PriceHistory {
|
|||
|
||||
class PriceUpdater {
|
||||
public historyInserted = false;
|
||||
private timeBetweenUpdatesMs = 3600000 / config.MEMPOOL.PRICE_UPDATES_PER_HOUR;
|
||||
private timeBetweenUpdatesMs = 360_0000 / config.MEMPOOL.PRICE_UPDATES_PER_HOUR;
|
||||
private cyclePosition = -1;
|
||||
private firstRun = true;
|
||||
private lastTime = -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue