From b66efad7b2459db25836969802365edacd5db509 Mon Sep 17 00:00:00 2001 From: "davidzhang.zc" Date: Fri, 5 Nov 2021 10:59:34 +0800 Subject: [PATCH] [add] hot ttl for golang sdk [modify] refine request timeout --- log_store.go | 2 +- request.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/log_store.go b/log_store.go index e4e5589c..69d5d5c5 100644 --- a/log_store.go +++ b/log_store.go @@ -27,8 +27,8 @@ type LogStore struct { AutoSplit bool `json:"autoSplit"` MaxSplitShard int `json:"maxSplitShard"` AppendMeta bool `json:"appendMeta"` - ArchiveSecons int `json:"archiveSeconds"` TelemetryType string `json:"telemetryType"` + HotTTL int `json:"hot_ttl"` CreateTime uint32 `json:"createTime,omitempty"` LastModifyTime uint32 `json:"lastModifyTime,omitempty"` diff --git a/request.go b/request.go index 1fd1ec8e..c161b8da 100644 --- a/request.go +++ b/request.go @@ -5,27 +5,27 @@ import ( "crypto/md5" "encoding/json" "fmt" - "github.com/go-kit/kit/log/level" "io/ioutil" "net/http" "net/http/httputil" "net/url" "time" + "github.com/go-kit/kit/log/level" + "github.com/cenkalti/backoff" "golang.org/x/net/context" ) // timeout configs var ( - defaultRequestTimeout = 10 * time.Second - defaultRetryTimeout = 30 * time.Second + defaultRequestTimeout = 60 * time.Second + defaultRetryTimeout = 90 * time.Second defaultHttpClient = &http.Client{ Timeout: defaultRequestTimeout, } ) - func retryReadErrorCheck(ctx context.Context, err error) (bool, error) { if err == nil { return false, nil