Reduce network change detection to 5s #10

Merged
razvandimescu merged 1 commits from fix/fast-network-detect into main 2026-03-23 03:47:25 +08:00
razvandimescu commented 2026-03-23 01:36:36 +08:00 (Migrated from github.com)

Summary

  • Tiered polling: LAN IP checked every 5s (cheap ~0.1ms UDP socket call), full upstream re-detection every 30s as safety net
  • Immediate trigger: when LAN IP changes, upstream re-detection runs immediately instead of waiting for the 30s cycle
  • Reduces worst-case recovery from 30s to 5s after switching Wi-Fi networks

No new dependencies. 8 lines changed.

Test plan

  • make all passes (fmt, clippy, audit, build)
  • Switch Wi-Fi networks, verify DNS recovers within ~5s
  • Verify scutil is NOT called every 5s (only every 30s or on IP change)

🤖 Generated with Claude Code

## Summary - **Tiered polling**: LAN IP checked every 5s (cheap ~0.1ms UDP socket call), full upstream re-detection every 30s as safety net - **Immediate trigger**: when LAN IP changes, upstream re-detection runs immediately instead of waiting for the 30s cycle - **Reduces worst-case recovery** from 30s to 5s after switching Wi-Fi networks No new dependencies. 8 lines changed. ## Test plan - [x] `make all` passes (fmt, clippy, audit, build) - [x] Switch Wi-Fi networks, verify DNS recovers within ~5s - [x] Verify `scutil` is NOT called every 5s (only every 30s or on IP change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.