Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix: use events to delay before self-query #478

Merged
merged 1 commit into from
May 26, 2023

Conversation

achingbrain
Copy link
Member

Instead of debouncing and using timeouts to wait for DHT peers before running the initial self-query, instead get the routing table to emit events when peers are added or removed - if the table is empty when we run the self-query, wait for the peer:add event before continuing.

Improves startup time.

Adds tests for the query-self component.

Instead of debouncing and using timeouts to wait for DHT peers before
running the initial self-query, instead get the routing table to emit
events when peers are added or removed - if the table is empty when
we run the self-query, wait for the `peer:add` event before
continuing.

Improves startup time.
@achingbrain achingbrain requested a review from maschad May 25, 2023 17:58
Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

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

Appreciate this improvement, a more methodical way to run self-queries.

My only question, is this a breaking change with introduction of the QuerySelfComponents instead of KadDHTComponents ?

Otherwise looks good.

@achingbrain
Copy link
Member Author

It’s an internal component so not a breaking change.

@achingbrain achingbrain merged commit 46313a8 into master May 26, 2023
@achingbrain achingbrain deleted the fix/use-events-for-self-query branch May 26, 2023 14:42
github-actions bot pushed a commit that referenced this pull request May 26, 2023
## [9.3.5](v9.3.4...v9.3.5) (2023-05-26)

### Bug Fixes

* use events to delay before self-query ([#478](#478)) ([46313a8](46313a8))

### Dependencies

* **dev:** bump delay from 5.0.0 to 6.0.0 ([#476](#476)) ([50524f9](50524f9))
@github-actions
Copy link

🎉 This PR is included in version 9.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants