fix:handle error and remove Redundant type conversion

Signed-off-by: jianfei.zhang <jianfei.zhang@daocloud.io>
This commit is contained in:
jianfei.zhang
2022-07-15 15:15:23 +08:00
parent f3654386ab
commit 49e7a7b51d
5 changed files with 25 additions and 19 deletions

View File

@@ -28,13 +28,13 @@ const (
// that GoroutineMap will refuse to allow another operation to start with
// the same target (if exponentialBackOffOnError is enabled). Each
// successive error results in a wait 2x times the previous.
initialDurationBeforeRetry time.Duration = 500 * time.Millisecond
initialDurationBeforeRetry = 500 * time.Millisecond
// maxDurationBeforeRetry is the maximum amount of time that
// durationBeforeRetry will grow to due to exponential backoff.
// Value is slightly offset from 2 minutes to make timeouts due to this
// constant recognizable.
maxDurationBeforeRetry time.Duration = 2*time.Minute + 2*time.Second
maxDurationBeforeRetry = 2*time.Minute + 2*time.Second
)
// ExponentialBackoff contains the last occurrence of an error and the duration