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

fix: clean up stale nodes from database #127

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

yilmazbahadir
Copy link
Contributor

@yilmazbahadir yilmazbahadir commented Jan 11, 2022

fixes #122

What is the fix?

  • We check the node.apiStatus.isAvailable and node.peerStatus.isAvailable fields according to the node's role and store lastAvailable(type: Date) field in the nodes collection.
  • We are keeping the unavailable node until monitor.KEEP_STALE_NODES_FOR_HOURS (default 3 days - configurable via environment variable) is met then remove from the nodes collection if still unavailable.
  • Added unit tests to make sure the logic is intact.

@yilmazbahadir yilmazbahadir force-pushed the fix/gh_122-clean-up-stale-nodes-from-db branch from e43779d to 9745334 Compare January 11, 2022 15:52
@yilmazbahadir yilmazbahadir merged commit 0f5af03 into dev Jan 13, 2022
@yilmazbahadir yilmazbahadir deleted the fix/gh_122-clean-up-stale-nodes-from-db branch January 13, 2022 19:40
@yilmazbahadir yilmazbahadir mentioned this pull request Jan 18, 2022
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.

Clean up stale nodes from DB
2 participants