refactor: simplify DNS discovery fallback#423
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
ada9bcc to
5601598
Compare
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.
5601598 to
a8a124f
Compare
Use a
tokio::time::Intervalin the maintenance loop'sselect!instead of manualSystemTimeelapsed 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:
Summary by CodeRabbit