MCPcopy
hub / github.com/nextdns/nextdns / Start

Method Start

run.go:55–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53}
54
55func (p *proxySvc) Start() (err error) {
56 p.log.Infof("Starting NextDNS %s/%s on %s", version, platform, strings.Join(p.Addrs, ", "))
57 backoff := 100 * time.Millisecond
58 for {
59 if err = p.start(); err != nil {
60 if isErrNetUnreachable(err) {
61 p.log.Infof("Network not yet ready, waiting")
62 time.Sleep(backoff)
63 backoff <<= 1
64 continue
65 }
66 return err
67 }
68 break
69 }
70 for _, f := range p.OnStarted {
71 f()
72 }
73 return nil
74}
75
76func isErrNetUnreachable(err error) bool {
77 if strings.Contains(err.Error(), "network is unreachable") {

Callers

nothing calls this directly

Calls 3

startMethod · 0.95
isErrNetUnreachableFunction · 0.70
InfofMethod · 0.65

Tested by

no test coverage detected