Compare commits
2 Commits
v1.5.14
...
ros_trud_1
| Author | SHA1 | Date | |
|---|---|---|---|
| 332bd7f560 | |||
| 10d6e90dfe |
@@ -1,4 +1,4 @@
|
||||
## Version 1.5.13
|
||||
## Version 1.5.16
|
||||
|
||||
### Bugfix
|
||||
- Fix EOF error by closing request
|
||||
|
||||
12
client.go
12
client.go
@@ -147,16 +147,16 @@ func (dc *DecortClient) do(req *http.Request) (*http.Response, error) {
|
||||
req.Close = true
|
||||
if err != nil || resp == nil {
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
resp.Body.Close()
|
||||
for i := uint64(0); i < dc.cfg.Retries; i++ {
|
||||
time.Sleep(5 * time.Second)
|
||||
resp, err = dc.client.Do(req)
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
resp.Body.Close()
|
||||
continue
|
||||
} else if err == nil {
|
||||
if err == nil {
|
||||
break
|
||||
} else if err != nil {
|
||||
}
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,16 +148,16 @@ func (ldc *LegacyDecortClient) do(req *http.Request) (*http.Response, error) {
|
||||
req.Close = true
|
||||
if err != nil || resp == nil {
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
resp.Body.Close()
|
||||
for i := uint64(0); i < ldc.cfg.Retries; i++ {
|
||||
time.Sleep(5 * time.Second)
|
||||
resp, err = ldc.client.Do(req)
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
resp.Body.Close()
|
||||
continue
|
||||
} else if err == nil {
|
||||
if err == nil {
|
||||
break
|
||||
} else if err != nil {
|
||||
}
|
||||
if strings.Contains(err.Error(), "connection reset by peer") || errors.Is(err, io.EOF) {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user