MCPcopy
hub / github.com/CodisLabs/codis / Start

Method Start

pkg/proxy/jodis.go:101–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101func (j *Jodis) Start() {
102 j.mu.Lock()
103 defer j.mu.Unlock()
104 if j.online {
105 return
106 }
107 j.online = true
108
109 go func() {
110 var delay = &DelayExp2{
111 Min: 1, Max: 30,
112 Unit: time.Second,
113 }
114 for !j.IsClosed() {
115 w, err := j.Rewatch()
116 if err != nil {
117 log.WarnErrorf(err, "jodis watch node %s failed", j.path)
118 delay.SleepWithCancel(j.IsClosed)
119 } else {
120 <-w
121 delay.Reset()
122 }
123 }
124 }()
125}

Callers

nothing calls this directly

Calls 5

IsClosedMethod · 0.95
RewatchMethod · 0.95
WarnErrorfMethod · 0.80
SleepWithCancelMethod · 0.65
ResetMethod · 0.65

Tested by

no test coverage detected