()
| 429 | } |
| 430 | |
| 431 | func (c *Cloud) startKubernetesGatherTask() { |
| 432 | log.Infof("cloud (%s) kubernetes gather task started", c.basicInfo.Name, logger.NewORGPrefix(c.orgID)) |
| 433 | c.runKubernetesGatherTask() |
| 434 | ticker := time.NewTicker(time.Duration(c.cfg.KubernetesGatherInterval) * time.Second) |
| 435 | go func() { |
| 436 | defer ticker.Stop() |
| 437 | |
| 438 | for { |
| 439 | select { |
| 440 | case <-c.cCtx.Done(): |
| 441 | log.Infof("cloud (%s) kubernetes gather task stopped", c.basicInfo.Name, logger.NewORGPrefix(c.orgID)) |
| 442 | return |
| 443 | case <-ticker.C: |
| 444 | c.runKubernetesGatherTask() |
| 445 | } |
| 446 | } |
| 447 | }() |
| 448 | } |
| 449 | |
| 450 | func (c *Cloud) runKubernetesGatherTask() { |
| 451 | var domain metadbmodel.Domain |
no test coverage detected