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

Cache all api.query queries #22

Merged
merged 5 commits into from
Aug 13, 2021
Merged

Cache all api.query queries #22

merged 5 commits into from
Aug 13, 2021

Conversation

ef1rspb
Copy link
Contributor

@ef1rspb ef1rspb commented Aug 13, 2021

Before: indexer is stuck on block https://polkadot.subscan.io/block/1750534?tab=event for 140 sec
Screenshot 2021-08-13 at 09 45 32
After: down to 25 sec
Screenshot 2021-08-13 at 09 47 09

if (cachedValue !== undefined) {
return cachedValue
} else {
let eraStakers = await api.query.staking.erasStakers.entries(era);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we query and save this guys also when election comlpetes. So one improvement in future is to reuse that data.

@ef1rspb ef1rspb merged commit 05ff92d into master Aug 13, 2021
@ef1rspb ef1rspb deleted the cache branch August 13, 2021 07:10
stepanLav pushed a commit that referenced this pull request Jul 1, 2024
Update CIDs for IFPS ready for network
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.

2 participants