fix(upstream-http): Properly close http body to fix goroutine leak.
This commit is contained in:
@@ -134,7 +134,8 @@ func upstreamFiber(name string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if r.StatusCode != 200 {
|
if r.StatusCode != 200 {
|
||||||
fmt.Fprintf(os.Stderr, "Request to %s for stream %s failed with status code %d\n", upstreams[name], name, err)
|
fmt.Fprintf(os.Stderr, "Request to %s for stream %s failed with status code %d\n", upstreams[name], name, r.StatusCode)
|
||||||
|
r.Body.Close()
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user