waitForLeftoverCleanup blocks until startup leftover recovery has restored OS network state (so the DNS override from a prior crash is gone) or the cap elapses — whichever first. Bounded so a stuck/elevation-blocked cleanup never strands the refresh; the cache is already applied, so a missed refresh
(max time.Duration)
| 3038 | // strands the refresh; the cache is already applied, so a missed refresh is |
| 3039 | // harmless. |
| 3040 | func (a *App) waitForLeftoverCleanup(max time.Duration) { |
| 3041 | if a.leftoverDone == nil { |
| 3042 | return |
| 3043 | } |
| 3044 | timer := time.NewTimer(max) |
| 3045 | defer timer.Stop() |
| 3046 | select { |
| 3047 | case <-a.leftoverDone: |
| 3048 | case <-timer.C: |
| 3049 | case <-a.ctx.Done(): |
| 3050 | } |
| 3051 | } |
| 3052 | |
| 3053 | func (a *App) startSmartBlockedRefresh(cachePath, cidrCachePath string) { |
| 3054 | if a.ctx == nil || a.proxy == nil || a.smartProvider == nil { |
no test coverage detected