-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add flag to configure API & dashboard's write timeouts #4474
Conversation
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were sort of standardizing on using time.Duration
for these types of flags going forward? Then the flag can take values like 5ms
, 15s
, ...
Yes please @ccressent! I think using the string representation of time.Duration should be our standard, considering it has first class support in our argument parser. |
backend/cmd/start.go
Outdated
@@ -512,12 +518,14 @@ func flagSet(server bool) *pflag.FlagSet { | |||
flagSet.String(flagAPIListenAddress, viper.GetString(flagAPIListenAddress), "address to listen on for api traffic") | |||
flagSet.Int64(flagAPIRequestLimit, viper.GetInt64(flagAPIRequestLimit), "maximum API request body size, in bytes") | |||
flagSet.String(flagAPIURL, viper.GetString(flagAPIURL), "url of the api to connect to") | |||
flagSet.Int64(flagAPIWriteTimeout, viper.GetInt64(flagAPIWriteTimeout), "maximum duration before timing out writes of responses") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the others have mentioned, let's use viper.GetDuration()
here instead and update the types surrounding this flag to time.Duration
.
Signed-off-by: James Phillips <jamesdphillips@gmail.com>
@ccressent good call! updated to use |
Bit of a bummer but I can't think of an easy way to migrate |
@jamesdphillips yeah it's fine to leave it as is. We can add it to the list of things we want to break with 7.x... |
Adds
api-write-timeout
&dashboard-write-timeout
flags to allow users to configure the respective HTTP server's write timeout. Useful when some requests might reasonably take more than a few seconds to complete.Signed-off-by: James Phillips jamesdphillips@gmail.com