Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Oct 31, 2024
1 parent fed73a4 commit 9caf205
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions go/vt/vtorc/logic/tablet_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,12 @@ func OpenTabletDiscovery() <-chan time.Time {
if _, err := db.ExecVTOrc("delete from vitess_tablet"); err != nil {
log.Error(err)
}
// We refresh all information from the topo once before we start the ticks to do it on a timer.
populateAllInformation()
return time.Tick(time.Second * time.Duration(config.Config.TopoInformationRefreshSeconds)) //nolint SA1015: using time.Tick leaks the underlying ticker
}

// populateAllInformation initializes all the information for VTOrc to function.
func populateAllInformation() {
// We can wait forever (context.Background()) for this call.
// We refresh all information from the topo once before we start the ticks to do
// it on a timer. We can wait forever (context.Background()) for this call.
if err := refreshAllInformation(context.Background()); err != nil {
log.Errorf("failed to initialize topology information: %+v", err)
}
return time.Tick(time.Second * time.Duration(config.Config.TopoInformationRefreshSeconds)) //nolint SA1015: using time.Tick leaks the underlying ticker
}

// refreshAllTablets reloads the tablets from topo and discovers the ones which haven't been refreshed in a while
Expand Down

0 comments on commit 9caf205

Please sign in to comment.