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

restart cache for tests #2906

Merged
merged 6 commits into from
Dec 7, 2019
Merged

restart cache for tests #2906

merged 6 commits into from
Dec 7, 2019

Conversation

ayrat555
Copy link
Contributor

@ayrat555 ayrat555 commented Dec 3, 2019

on the first call address sum cache starts a task to
fetch a value from the DB and return nil

Related commit b87fc2d

Changelog

  • fix address sum cache

on the first call address sum cache starts task to
fetch a value from the DB and return nil
@coveralls
Copy link

coveralls commented Dec 3, 2019

Pull Request Test Coverage Report for Build c71f64ad-9fdd-4717-818a-548d8bfe5924

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 75.082%

Files with Coverage Reduction New Missed Lines %
apps/explorer/lib/explorer/chain_spec/genesis_data.ex 5 9.09%
Totals Coverage Status
Change from base Build a1a69079-3d64-4894-883b-59ad1aa9f02d: -0.07%
Covered Lines: 5279
Relevant Lines: 7031

💛 - Coveralls

@vbaranov vbaranov self-requested a review December 3, 2019 11:09
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.

@ayrat555 mox tests are in a failed state

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.

@ayrat555 endpoint works very slow now: > 10 sec. It looks like it doesn't take data from cache but makes a query on DB on call, does it?

@ayrat555
Copy link
Contributor Author

ayrat555 commented Dec 6, 2019

@vbaranov I just checked it. And it fetches from the db on the first call. All other calls use a cached value. It re-fetches value after global_ttl. What is the value of ADDRESS_SUM_CACHE_PERIOD env var?

@vbaranov
Copy link
Member

vbaranov commented Dec 6, 2019

@ayrat555 1 minute in my test. What is the problem to keep this endpoint async? This endpoint will be used by exchanges. And there will be downtime if it will be called at the time of cache updating. I urge to keep this endpoint async and fix tests for it instead of making it synchronous. I don't see the problem if it will return 0 on the first call. This is less painful than to have a synchronous endpoint, I think.

@ayrat555
Copy link
Contributor Author

ayrat555 commented Dec 7, 2019

@vbaranov I addressed your comment. Now this PR just fixes tests

@vbaranov vbaranov self-requested a review December 7, 2019 18:48
@vbaranov vbaranov merged commit da54650 into master Dec 7, 2019
@vbaranov vbaranov deleted the ab-fix-address-sum-cache1 branch December 7, 2019 18:49
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

3 participants