MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / migrationLoop

Method migrationLoop

controller/cluster.go:405–428  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403}
404
405func (c *ClusterChecker) migrationLoop() {
406 defer c.wg.Done()
407
408 ticker := time.NewTicker(time.Second)
409 defer ticker.Stop()
410 for {
411 select {
412 case <-c.ctx.Done():
413 return
414 case <-ticker.C:
415 c.clusterMu.Lock()
416 if c.cluster == nil {
417 c.clusterMu.Unlock()
418 continue
419 }
420 clonedCluster := c.cluster.Clone()
421 c.clusterMu.Unlock()
422 if clonedCluster == nil {
423 continue
424 }
425 c.tryUpdateMigrationStatus(c.ctx, clonedCluster)
426 }
427 }
428}
429
430func (c *ClusterChecker) Close() {
431 c.cancelFn()

Callers 1

StartMethod · 0.95

Calls 3

StopMethod · 0.45
CloneMethod · 0.45

Tested by

no test coverage detected