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

Clear cache #23

Merged
merged 1 commit into from
Aug 19, 2021
Merged

Clear cache #23

merged 1 commit into from
Aug 19, 2021

Conversation

ef1rspb
Copy link
Contributor

@ef1rspb ef1rspb commented Aug 19, 2021

No description provided.

let eraStakersByEra: {[era: number]: [StorageKey<[EraIndex, AccountId]>, Exposure][]} = {}

export async function cachedEraStakers(era: number): Promise<[StorageKey<[EraIndex, AccountId]>, Exposure][]> {
let cachedValue = eraStakersByEra[era]
if (cachedValue !== undefined) {
return cachedValue
} else {
eraStakersByEra = {}
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 should try to use database (and benefit it's own cache) because we store EraValidatorInfo entity

@ef1rspb ef1rspb merged commit dfcdb65 into master Aug 19, 2021
@ef1rspb ef1rspb deleted the clear-cache branch August 19, 2021 07:58
stepanLav pushed a commit that referenced this pull request Jul 1, 2024
set min runner version to 4.6.6
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