Skip to content

Commit 0de9c72

Browse files
committed
Fix retry-num parameter handling.
This introduces --retry-num and --retry-after command-line parameters and makes sure the value for `retry-num' is more than zero as otherwise the ARP client is not being launched. Fixes: #272
1 parent c32449e commit 0de9c72

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vipconfig/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func defineFlags() {
7272
pflag.String("interval", "1000", "DCS scan interval in milliseconds.")
7373
pflag.String("manager-type", "basic", "Type of VIP-management to be used. Supported values: basic, hetzner.")
7474

75+
pflag.String("retry-after", "250", "Time to wait before retrying interactions with outside components in milliseconds.")
76+
pflag.String("retry-num", "3", "Number of times interactions with outside components are retried.")
77+
7578
pflag.Bool("verbose", false, "Be verbose. Currently only implemented for manager-type=hetzner .")
7679

7780
pflag.CommandLine.SortFlags = false
@@ -200,6 +203,11 @@ func setDefaults() {
200203
viper.Set("trigger-value", triggerValue)
201204
}
202205
}
206+
207+
// set retry-num to default if not set or set to zero
208+
if retryNum := viper.GetString("retry-num"); retryNum == "" || retryNum == "0" {
209+
viper.Set("retry-num", 3)
210+
}
203211
}
204212

205213
func checkSetting(name string) bool {

0 commit comments

Comments
 (0)