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

checkForMissedBlocks is scheduled using nested setTimeout #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nlipartiia-hacken
Copy link
Collaborator

@nlipartiia-hacken nlipartiia-hacken commented Dec 2, 2022

Close #14

I couldn't catch this error, so I changed timeout for checkForLatestBlock:

 setInterval(() => {
    checkForLatestBlock()
  }, TIMEOUT * 7)

This way indexer misses blocks more often and in less than 10 minutes I received this error. I think this change doesn't impact the issue.

I checked some logs and I think the problem is in scheduling checkForMissedBlocks, it seems like new checkForMissedBlocks starts before the previous one is complete, thus blockHeights isn't updated and the last missed block is added twice.

So I changed the scheduling of checkForMissedBlocks so that in starts executing only after the previous one is finished. I ran it for some time and I think it is fixed.

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.

Issue when fixing missing block
1 participant