MCPcopy Create free account
hub / github.com/deepflowio/deepflow / run

Method run

server/controller/cloud/cloud.go:397–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

395}
396
397func (c *Cloud) run() {
398 log.Infof("cloud (%s) started", c.basicInfo.Name, logger.NewORGPrefix(c.orgID))
399
400 if err := c.platform.CheckAuth(); err != nil {
401 log.Errorf("cloud (%+v) check auth failed", c.basicInfo, logger.NewORGPrefix(c.orgID))
402 }
403
404 // execute immediately upon startup
405 if c.dailyTrigger() {
406 c.getCloudData()
407 }
408
409 cloudGatherInterval := c.getCloudGatherInterval()
410 c.basicInfo.Interval = cloudGatherInterval
411 ticker := time.NewTicker(time.Second * time.Duration(cloudGatherInterval))
412 defer ticker.Stop()
413
414 for {
415 select {
416 case <-ticker.C:
417 if c.synchronizing {
418 continue
419 }
420 if !c.dailyTrigger() {
421 continue
422 }
423 c.getCloudData()
424 case <-c.cCtx.Done():
425 log.Infof("cloud (%s) stopped", c.basicInfo.Name, logger.NewORGPrefix(c.orgID))
426 return
427 }
428 }
429}
430
431func (c *Cloud) startKubernetesGatherTask() {
432 log.Infof("cloud (%s) kubernetes gather task started", c.basicInfo.Name, logger.NewORGPrefix(c.orgID))

Callers 1

StartMethod · 0.95

Calls 7

dailyTriggerMethod · 0.95
getCloudDataMethod · 0.95
CheckAuthMethod · 0.65
StopMethod · 0.65
InfofMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected