remove some http hard code (#2047)
Co-authored-by: yonbiaoxiao <yonbiaoxiao@tencent.com>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user