Standardize polling - #656
Conversation
a86f603 to
1353a3b
Compare
|
|
||
| export const dashboardNewBlocks = (page$, latestBlock$) => | ||
| page$ | ||
| .switchMap(page => page && page.pathname == '/' |
There was a problem hiding this comment.
Should we use view$ == 'dashBoard' instead of page.pathname == '/'?
There was a problem hiding this comment.
view$ has a loading state that would delay the establishment of the stream. Delaying the establishment of the stream might cause us to skip a new block ('new' being any block after the initial one) instead of just the initial one.
| , bitcoinMarketChartUrl = process.env.BITCOIN_MARKET_CHART_URL || 'https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=usd&days=1&interval=hourly' | ||
| , blockTemplatePollIntervalMs = 30000 | ||
| , blockTemplatePollIntervalMs = pollIntervalsMs.fast | ||
| , tipRequestThrottleMs = 5000 |
There was a problem hiding this comment.
It wasn't added to the new pollIntervalsMs table, even though the whole point of the PR was to consolidate all the intervals in one place. It's a minor issue.
There was a problem hiding this comment.
The throttle is different from the polling. It represents how often the request can be made (mainly to limit event-triggered requests like navigating to tx page)
To alleviate the burden on user rate limits, I reduced the polling cadence for some endpoints to something more manageable (and standardized polling intervals in const.js).
Here's a summary of the changes:
once every 5s
To run locally, npm install and use the following snippets: