Skip to content

Commit

Permalink
improve timeout config
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Sep 27, 2023
1 parent 3fd1455 commit 2b937f7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sdk/api_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,15 @@ var apiTimeouts = `{
}
`

var timeout map[string]map[string]int

func init() {
timeout = make(map[string]map[string]int)
json.Unmarshal([]byte(apiTimeouts), &timeout)
}

func getAPIMaxTimeout(product, actionName string) (time.Duration, bool) {
timeout := make(map[string]map[string]int)
err := json.Unmarshal([]byte(apiTimeouts), &timeout)
if err != nil {
if timeout == nil {
return 0 * time.Millisecond, false
}

Expand Down

0 comments on commit 2b937f7

Please sign in to comment.