fasthttp icon indicating copy to clipboard operation
fasthttp copied to clipboard

Timeout?

Open jney opened this issue 2 years ago • 1 comments

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?

jney avatar Apr 25 '23 16:04 jney

What version are you using? v1.46 contained a fix that might be relevant here: https://github.com/valyala/fasthttp/commit/87cb886157ae414e178fd5bc14a57d5e1c8fcadb

erikdubbelboer avatar Apr 26 '23 06:04 erikdubbelboer