Patch for http.get
only return after timeout
#25381
Unanswered
jorgeluismireles
asked this question in
Questions and Answers
Replies: 1 comment
-
Even though the large waiting time can be mitigated if we can reduce max_retries (only for not responding services) and timeouts, I think only using ...
mut req := http.prepare(url: page) or {
h.get_errs << ip
h.println(ip, '-', '-', sw.elapsed(), 'prepare error:${err}')
return
}
req.max_retries = 1
req.read_timeout = 5 * time.second
req.write_timeout = 5 * time.second
resp := req.do() or {
h.get_errs << ip
h.println(ip, '-', '-', sw.elapsed(), 'request error:${err}')
return
}
if resp.status_code == 200 {
...
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@spytheman
@JalonSolov
I open a discussion here about issue #20283 here because
The patch consist in
expected_size
outside branchif req.on_progress_body != unsafe { nil } {
otherwise remains in zero.expected_size != 0 && expected_size <= new_len)
new_len
andexpected_size
.Beta Was this translation helpful? Give feedback.
All reactions