Skip to content

Commit

Permalink
feat: fix vtconsensus loop
Browse files Browse the repository at this point in the history
  • Loading branch information
earayu committed Dec 28, 2023
1 parent 45a88ac commit abac1f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/vtconsensus/vtconsensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (vtconsensus *VTConsensus) RefreshCluster() {
ticker := time.Tick(refreshInterval)
for range ticker {
if !enableVtconsensus {
return
continue
}
ctx, cancel := context.WithTimeout(vtconsensus.ctx, refreshInterval)
shard.RefreshTabletsInShardWithLock(ctx)
Expand All @@ -182,10 +182,10 @@ func (vtconsensus *VTConsensus) ScanAndRepair() {
scanInterval.Seconds(), scanAndRepairTimeout.Seconds())
ticker := time.Tick(scanInterval)
for range ticker {
if !enableVtconsensus {
continue
}
func() {
if !enableVtconsensus {
return
}
ctx, cancel := context.WithTimeout(vtconsensus.ctx, scanAndRepairTimeout)
defer cancel()
if !vtconsensus.stopped.Get() {
Expand Down

0 comments on commit abac1f5

Please sign in to comment.