Skip to content

Commit cf3760d

Browse files
authored
fix: only return last error for retry (#167)
1 parent 762d968 commit cf3760d

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.1
1+
0.8.2

client.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"maps"
1313
"math/rand"
1414
"mime/multipart"
15-
"net"
1615
"net/http"
1716
"strings"
1817
"time"
@@ -383,17 +382,6 @@ func encode(name string, key string) string {
383382
return base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", name, key)))
384383
}
385384

386-
// databendInsecureTransport is the transport object that doesn't do certificate revocation check.
387-
var databendInsecureTransport = &http.Transport{
388-
MaxIdleConns: 10,
389-
IdleConnTimeout: 30 * time.Minute,
390-
Proxy: http.ProxyFromEnvironment,
391-
DialContext: (&net.Dialer{
392-
Timeout: 30 * time.Second,
393-
KeepAlive: 30 * time.Second,
394-
}).DialContext,
395-
}
396-
397385
func (c *APIClient) getPaginationConfig() *PaginationConfig {
398386
if c.MaxRowsPerPage == 0 && c.MaxRowsInBuffer == 0 && c.WaitTimeSeconds == 0 {
399387
return nil
@@ -501,6 +489,7 @@ func (c *APIClient) doRetry(f retry.RetryableFunc, t RequestType) error {
501489
retry.Delay(delay*time.Second),
502490
retry.Attempts(attempts),
503491
retry.DelayType(retry.FixedDelay),
492+
retry.LastErrorOnly(true),
504493
)
505494
}
506495

0 commit comments

Comments
 (0)