Variable "timeout"
Hello Andy, exploring the source code it seems the "Timeout" is hard-coded to 30 sec for the connection, correct ? would it be possible to add a variable "timeout" in the "config.go" (applied to tls.go and/or transport.go) in order to increase/decrease the connection timeout ? we mainly use Redwood as Classification Service to get the category and 30 sec is an issue as we need to get the answer as fast as possible...
thanks in advance :o) Bye Fred
I don't think the classification service uses either of those timeouts, because it uses http.DefaultClient. You could set up an http.Client that uses a dialer with a custom timeout, but it might actually be better to set a higher-level timeout on the request context.
You could replace NewRequest with NewRequestWithContext, something like this:
- req, err := http.NewRequest("GET", url, nil)
+ req, err := http.NewRequestWithContext(context.WithTimeout(r.Context(), conf.ClassifyTimeout), "GET", url, nil)
thanks Andy, we'll try ;o)