Skip to content

Commit

Permalink
cleanup again
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Feb 18, 2025
1 parent 9bde970 commit f67a387
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/vt/vtorc/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func RegisterFlags(fs *pflag.FlagSet) {
// strictly expected from user.
// TODO(sougou): change this to yaml parsing, and possible merge with tabletenv.
type Configuration struct {
DiscoveryMaxConcurrency uint // Number of goroutines dedicated to doing hosts discovery.
SQLite3DataFile string // full path to sqlite3 datafile
InstancePollSeconds uint // Number of seconds between instance reads
SnapshotTopologiesIntervalHours uint // Interval in hour between snapshot-topologies invocation. Default: 0 (disabled)
Expand All @@ -109,7 +110,6 @@ type Configuration struct {
TopoInformationRefreshSeconds int // Timer duration on which VTOrc refreshes the keyspace and vttablet records from the topo-server.
AllowRecovery bool // Allow recoveries.
RecoveryPollSeconds int // Timer duration on which VTOrc recovery analysis runs
DiscoveryMaxConcurrency uint // Number of goroutines dedicated to doing hosts discovery
}

// ToJSONString will marshal this configuration as JSON
Expand All @@ -125,6 +125,7 @@ var readFileNames []string
// UpdateConfigValuesFromFlags is used to update the config values from the flags defined.
// This is done before we read any configuration files from the user. So the config files take precedence.
func UpdateConfigValuesFromFlags() {
Config.DiscoveryMaxConcurrency = discoveryMaxConcurrency
Config.SQLite3DataFile = sqliteDataFile
Config.InstancePollSeconds = uint(instancePollTime / time.Second)
Config.InstancePollSeconds = uint(instancePollTime / time.Second)
Expand All @@ -141,7 +142,6 @@ func UpdateConfigValuesFromFlags() {
Config.TopoInformationRefreshSeconds = int(topoInformationRefreshDuration / time.Second)
Config.AllowRecovery = allowRecovery
Config.RecoveryPollSeconds = int(recoveryPollDuration / time.Second)
Config.DiscoveryMaxConcurrency = discoveryMaxConcurrency
}

// ERSEnabled reports whether VTOrc is allowed to run ERS or not.
Expand Down Expand Up @@ -172,6 +172,7 @@ func LogConfigValues() {

func newConfiguration() *Configuration {
return &Configuration{
DiscoveryMaxConcurrency: 300,
SQLite3DataFile: "file::memory:?mode=memory&cache=shared",
InstancePollSeconds: 5,
SnapshotTopologiesIntervalHours: 0,
Expand Down

0 comments on commit f67a387

Please sign in to comment.