Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache for block counter #1848

Merged
merged 1 commit into from
Apr 26, 2019
Merged

Add cache for block counter #1848

merged 1 commit into from
Apr 26, 2019

Conversation

saneery
Copy link
Contributor

@saneery saneery commented Apr 26, 2019

Changelog

  • added cache for block counter

ENV

  • BLOCK_COUNT_CACHE_TTL - time to live of cache in milliseconds

@ghost ghost assigned saneery Apr 26, 2019
@ghost ghost added the in progress label Apr 26, 2019
@saneery saneery added the ready for review This PR is ready for reviews. label Apr 26, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7ebfca67-163f-4bd9-92e5-91b53c4ec688

  • 27 of 28 (96.43%) changed or added relevant lines in 3 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 82.343%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/chain/block_count_cache.ex 24 25 96.0%
Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/fetcher/token.ex 1 78.57%
apps/indexer/lib/indexer/fetcher/token_balance.ex 2 87.1%
apps/indexer/lib/indexer/block/fetcher.ex 3 86.36%
Totals Coverage Status
Change from base Build ccb339f1-e3c9-40c7-be69-3f92f74e9423: 0.03%
Covered Lines: 4477
Relevant Lines: 5437

💛 - Coveralls

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saneery
we need a fallback to Postgres data for blocks count if it is not cached yet (as we did here https://github.com/poanetwork/blockscout/pull/1671/files for transactions counter). It is especially important on instance deployment when cache is empty.

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a separate issue to cover my previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants