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

Caching of address transactions counter, remove query 10_000 rows limit #3330

Merged
merged 6 commits into from
Oct 6, 2020

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Oct 5, 2020

Motivation

  1. Address transactions counter query is slow.
  2. If there are more than 10_000 transactions, UI displays >= 10000 instead of exact number

Changelog

  • Add caching of transactions counter at the address.
  • Remove 10_000 query limit.
  • A cache is expired if it was updated more than 1 hour ago by default.
  • ADDRESS_TRANSACTIONS_CACHE_PERIOD env var is introduced to manage address transactions counter cache update period (in seconds).

Checklist for your Pull Request (PR)

@coveralls
Copy link

coveralls commented Oct 5, 2020

Pull Request Test Coverage Report for Build ab9a7de02c943cfe242f45bd1e3bab0953ebe1e8-PR-3330

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+3.4%) to 74.67%

Files with Coverage Reduction New Missed Lines %
lib/block_scout_web/controllers/address_controller.ex 3 89.29%
Totals Coverage Status
Change from base Build f04fe57690d6aa8d4577521e0fe996bd1bdba4f0: 3.4%
Covered Lines: 1981
Relevant Lines: 2653

💛 - Coveralls

@vbaranov vbaranov merged commit d2ec9d2 into master Oct 6, 2020
@vbaranov vbaranov deleted the vb-exact-addr-txs-counter branch October 6, 2020 09:13
francishor pushed a commit to whizzlofficial/blockscout that referenced this pull request Oct 12, 2020
…counter

Caching of address transactions counter, remove query 10_000 rows limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants