Skip to content

Commit

Permalink
feat: 调整api timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
zenghur committed Jul 25, 2019
1 parent da81cf7 commit f31f05b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion error.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package aliacm

import "context"

// Error ACM错误
type Error string

Expand All @@ -14,7 +16,9 @@ const (

// ShouldIgnore 忽略一些不想关心的错误
func ShouldIgnore(err error) bool {
if err == serviceUnavailableErr || err == internalServerErr {
if err == serviceUnavailableErr ||
err == internalServerErr ||
err == context.Canceled {
return true
}
return false
Expand Down
2 changes: 1 addition & 1 deletion time.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

const (
apiTimeout = 3 * time.Second
apiTimeout = 5 * time.Second
)

func timeInMilli() int64 {
Expand Down

0 comments on commit f31f05b

Please sign in to comment.