Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retry-num parameter handling. #279

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vipconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func defineFlags() {
pflag.String("interval", "1000", "DCS scan interval in milliseconds.")
pflag.String("manager-type", "basic", "Type of VIP-management to be used. Supported values: basic, hetzner.")

pflag.String("retry-after", "250", "Time to wait before retrying interactions with outside components in milliseconds.")
pflag.String("retry-num", "3", "Number of times interactions with outside components are retried.")

pflag.Bool("verbose", false, "Be verbose. Currently only implemented for manager-type=hetzner .")

pflag.CommandLine.SortFlags = false
Expand Down Expand Up @@ -200,6 +203,11 @@ func setDefaults() {
viper.Set("trigger-value", triggerValue)
}
}

// set retry-num to default if not set or set to zero
if retryNum := viper.GetString("retry-num"); retryNum == "" || retryNum == "0" {
viper.Set("retry-num", 3)
}
}

func checkSetting(name string) bool {
Expand Down
Loading