Skip to content

Commit

Permalink
txthrottler: further code cleanup (vitessio#12902)
Browse files Browse the repository at this point in the history
* txthrottler: further code cleanup

Signed-off-by: Tim Vaillancourt <[email protected]>

* Fix bad merge resolution

Signed-off-by: Tim Vaillancourt <[email protected]>

---------

Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Jun 28, 2023
1 parent c322ded commit 5a4a8c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/vttablet/tabletserver/txthrottler/tx_throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (t *txThrottler) Open() (err error) {
}
log.Info("txThrottler: opening")
t.throttlerRunning.Set(1)
t.state, err = newTxThrottlerState(t.topoServer, t.config, t.target.Keyspace, t.target.Shard, t.target.Cell)
t.state, err = newTxThrottlerState(t.topoServer, t.config, t.target)
return err
}

Expand Down Expand Up @@ -294,7 +294,7 @@ func (t *txThrottler) Throttle(priority int) (result bool) {
return result
}

func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, keyspace, shard, cell string) (*txThrottlerState, error) {
func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, target *querypb.Target) (*txThrottlerState, error) {
maxReplicationLagModuleConfig := throttler.MaxReplicationLagModuleConfig{Configuration: config.throttlerConfig}

t, err := throttlerFactory(
Expand Down Expand Up @@ -325,8 +325,8 @@ func newTxThrottlerState(topoServer *topo.Server, config *txThrottlerConfig, key
topoServer,
result.healthCheck, /* LegacyTabletRecorder */
cell,
keyspace,
shard,
target.Keyspace,
target.Shard,
discovery.DefaultTopologyWatcherRefreshInterval,
discovery.DefaultTopoReadConcurrency))
}
Expand Down

0 comments on commit 5a4a8c9

Please sign in to comment.