MCPcopy Index your code
hub / github.com/devspace-sh/devspace / startPing

Method startPing

pkg/devspace/sync/upstream.go:136–155  ·  view source on GitHub ↗
(doneChan chan struct{})

Source from the content-addressed store, hash-verified

134}
135
136func (u *upstream) startPing(doneChan chan struct{}) {
137 go func() {
138 for {
139 select {
140 case <-doneChan:
141 return
142 case <-time.After(time.Second * 15):
143 if u.client != nil {
144 ctx, cancel := context.WithTimeout(u.sync.ctx, time.Second*15)
145 _, err := u.client.Ping(ctx, &remote.Empty{})
146 cancel()
147 if err != nil {
148 u.sync.Stop(fmt.Errorf("ping connection: %v", err))
149 return
150 }
151 }
152 }
153 }
154 }()
155}
156
157func (u *upstream) startEventsLoop(doneChan chan struct{}) {
158 go func() {

Callers 1

StartMethod · 0.45

Calls 4

WithTimeoutMethod · 0.80
PingMethod · 0.65
StopMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected