Skip to content

Commit

Permalink
use an individual PR to add config
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Oct 28, 2024
1 parent 57e3218 commit 8a83dd2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ const (
minCheckRegionSplitInterval = 1 * time.Millisecond
maxCheckRegionSplitInterval = 100 * time.Millisecond

defaultEnableSchedulingFallback = true
defaultEnableTSODynamicSwitching = false
defaultEnableSchedulingFallback = true
)

// Special keys for Labels
Expand Down Expand Up @@ -855,17 +854,13 @@ func (c *DRAutoSyncReplicationConfig) adjust(meta *configutil.ConfigMetaData) {

// MicroServiceConfig is the configuration for micro service.
type MicroServiceConfig struct {
EnableSchedulingFallback bool `toml:"enable-scheduling-fallback" json:"enable-scheduling-fallback,string"`
EnableTSODynamicSwitching bool `toml:"enable-tso-dynamic-switching" json:"enable-tso-dynamic-switching,string"`
EnableSchedulingFallback bool `toml:"enable-scheduling-fallback" json:"enable-scheduling-fallback,string"`
}

func (c *MicroServiceConfig) adjust(meta *configutil.ConfigMetaData) {
if !meta.IsDefined("enable-scheduling-fallback") {
c.EnableSchedulingFallback = defaultEnableSchedulingFallback
}
if !meta.IsDefined("enable-dynamic-tso") {
c.EnableTSODynamicSwitching = defaultEnableTSODynamicSwitching
}
}

// Clone returns a copy of micro service config.
Expand All @@ -881,7 +876,8 @@ func (c *MicroServiceConfig) IsSchedulingFallbackEnabled() bool {

// IsTSODynamicSwitchingEnabled returns whether to enable TSO dynamic switching.
func (c *MicroServiceConfig) IsTSODynamicSwitchingEnabled() bool {

Check failure on line 878 in server/config/config.go

View workflow job for this annotation

GitHub Actions / statics

unused-receiver: method receiver 'c' is not referenced in method's body, consider removing or renaming it as _ (revive)
return c.EnableTSODynamicSwitching
// TODO: make it configurable
return false
}

// KeyspaceConfig is the configuration for keyspace management.
Expand Down

0 comments on commit 8a83dd2

Please sign in to comment.