(duo to context timeout).
but they are still running.
the slow request in line 16 can be anything. like a HTTP request by fasthttp library (fasthttp doesn't support context unlike net/http)
Can you refactor this code to make it work properly?
you have to pass the context to the HTTP request so whenever the context is canceled - the HTTP request is canceled.
fasthttp doesn't support context
it provides its own time-based cancelation https://godoc.org/github.com/valyala/fasthttp#Client.DoDeadline https://godoc.org/github.com/valyala/fasthttp#Client.DoTimeout
Обсуждают сегодня