Skip to content

Commit

Permalink
Cleanup tx_throttler.go #2
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Apr 15, 2023
1 parent 756d966 commit b15da5b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ var (
throttlerFactory throttlerFactoryFunc
)

func init() {
resetTxThrottlerFactories()
}

func resetTxThrottlerFactories() {
healthCheckFactory = func(topoServer *topo.Server, cell string, cellsToWatch []string) discovery.HealthCheck {
return discovery.NewHealthCheck(context.Background(), discovery.DefaultHealthCheckRetryDelay, discovery.DefaultHealthCheckTimeout, topoServer, cell, strings.Join(cellsToWatch, ","))
Expand All @@ -67,6 +63,10 @@ func resetTxThrottlerFactories() {
}
}

func init() {
resetTxThrottlerFactories()
}

// ThrottlerInterface defines the public interface that is implemented by go/vt/throttler.Throttler
// It is only used here to allow mocking out a throttler object.
type ThrottlerInterface interface {
Expand Down Expand Up @@ -153,7 +153,6 @@ func NewTxThrottler(env tabletenv.Env, topoServer *topo.Server) *TxThrottler {
} else {
log.Infof("Initialized transaction throttler with config: %+v", txThrottler.config)
}

return txThrottler
}

Expand Down

0 comments on commit b15da5b

Please sign in to comment.