Skip to content

refactor: simplify DNS discovery fallback#423

Draft
xdustinface wants to merge 1 commit intofix/use-stored-peersfrom
refactor/peer-search-started
Draft

refactor: simplify DNS discovery fallback#423
xdustinface wants to merge 1 commit intofix/use-stored-peersfrom
refactor/peer-search-started

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Feb 8, 2026

Use a tokio::time::Interval in the maintenance loop's select! instead of manual SystemTime elapsed tracking.
The interval arm is disabled in exclusive mode via a select guard and skips DNS if peers are already enough.

Also, the DNS lookup branch doesn't try to connect immediately but instead in the next loop cycle, which happens straight away.

Based on:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/peer-search-started

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Use a `tokio::time::Interval` in the maintenance loop's `select!`
instead of manual `SystemTime` elapsed tracking.
The interval arm is disabled in exclusive mode via a select guard and
skips DNS if peers are already enough.

Also, the DNS lookup branch doesn't try to connect immediately but instead in the next loop cycle, which happens straight away.
@xdustinface xdustinface force-pushed the refactor/peer-search-started branch from ada9bcc to 5601598 Compare February 8, 2026 15:02
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.

1 participant