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

Method mainLoop

pkg/devspace/sync/sync.go:209–230  ·  view source on GitHub ↗
(onInitUploadDone chan struct{}, onInitDownloadDone chan struct{})

Source from the content-addressed store, hash-verified

207}
208
209func (s *Sync) mainLoop(onInitUploadDone chan struct{}, onInitDownloadDone chan struct{}) {
210 s.log.Info("Start syncing")
211
212 // Start upstream as early as possible
213 if !s.Options.UpstreamDisabled {
214 go s.startUpstream()
215 }
216
217 // Start downstream and do initial sync
218 go func() {
219 err := s.initialSync(onInitUploadDone, onInitDownloadDone)
220 if err != nil {
221 s.Stop(errors.Wrap(err, "initial sync"))
222 return
223 }
224
225 if !s.Options.DownstreamDisabled {
226 s.startDownstream()
227 s.Stop(nil)
228 }
229 }()
230}
231
232func (s *Sync) startUpstream() {
233 defer s.Stop(nil)

Callers 3

StartMethod · 0.95
startUpstreamMethod · 0.45
startDownstreamMethod · 0.45

Calls 5

startUpstreamMethod · 0.95
initialSyncMethod · 0.95
StopMethod · 0.95
startDownstreamMethod · 0.95
InfoMethod · 0.45

Tested by

no test coverage detected