remove some http hard code (#2047)

Co-authored-by: yonbiaoxiao <yonbiaoxiao@tencent.com>
This commit is contained in:
xyb
2020-10-18 12:58:38 +08:00
committed by GitHub
parent 07b32ad3b9
commit 2e45567e56
6 changed files with 12 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package client
import (
"context"
"net/http"
"github.com/micro/go-micro/v3/errors"
)
@@ -27,7 +28,7 @@ func RetryOnError(ctx context.Context, req Request, retryCount int, err error) (
switch e.Code {
// retry on timeout or internal server error
case 408, 500:
case http.StatusRequestTimeout, http.StatusInternalServerError:
return true, nil
default:
return false, nil