Skip to content

Commit

Permalink
bind: and dial retry flags
Browse files Browse the repository at this point in the history
    --http-dial-attempts <int> (default 3) (env FORWARDER_HTTP_DIAL_ATTEMPTS)
        The number of attempts to dial the network address.

    --http-dial-backoff <duration> (default 1s) (env FORWARDER_HTTP_DIAL_BACKOFF)
        The amount of time to wait between dial attempts.
  • Loading branch information
mmatczuk committed Dec 6, 2024
1 parent e892179 commit 7568045
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bind/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ func DialConfig(fs *pflag.FlagSet, cfg *forwarder.DialConfig, prefix string) {
namePrefix+"dial-timeout", cfg.DialTimeout,
"The maximum amount of time a dial will wait for a connect to complete. "+
"With or without a timeout, the operating system may impose its own earlier timeout. For instance, TCP timeouts are often around 3 minutes. ")

fs.IntVar(&cfg.Retry.Attempts, namePrefix+"dial-attempts", cfg.Retry.Attempts,
"The number of attempts to dial the network address. ")

fs.DurationVar(&cfg.Retry.Backoff, namePrefix+"dial-backoff", cfg.Retry.Backoff,
"The amount of time to wait between dial attempts. ")
}

func ConnectTo(fs *pflag.FlagSet, cfg *[]forwarder.HostPortPair) {
Expand Down

0 comments on commit 7568045

Please sign in to comment.