fasthttp
fasthttp copied to clipboard
Timeout?
Hi. I'm trying to force requests to not be longer than a specified amount of time. My client uses the following parameters:
&fasthttp.Client{
ReadTimeout: 750*time.Millisecond,
WriteTimeout: 750*time.Millisecond,
}
And, when I make a request I use DoDeadline function:
cli.DoDeadline(req, res, time.Now().Add(750*time.Millisecond))
But, despite all of these, some requests still take more time than they should.
Using std lib http client with http.NewRequestWithContext no request takes longer than the allowed window.
Any idea how I can force this timeout?
What version are you using? v1.46 contained a fix that might be relevant here: https://github.com/valyala/fasthttp/commit/87cb886157ae414e178fd5bc14a57d5e1c8fcadb