mirror of
https://github.com/anomalyco/opencode-sdk-go.git
synced 2026-05-19 08:09:58 +00:00
fix: close body before retrying
This commit is contained in:
parent
a1074882ee
commit
4da3f7f372
1 changed files with 5 additions and 0 deletions
|
|
@ -464,6 +464,11 @@ func (cfg *RequestConfig) Execute() (err error) {
|
|||
break
|
||||
}
|
||||
|
||||
// Close the response body before retrying to prevent connection leaks
|
||||
if res != nil && res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
|
||||
time.Sleep(retryDelay(res, retryCount))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue