增加重试配置初始化 + 重试逻辑处理

This commit is contained in:
2024-05-31 18:51:31 +08:00
parent 0ba0f7dced
commit 196e81191a
4 changed files with 44 additions and 3 deletions

View File

@ -38,6 +38,14 @@ type requestConfig struct {
//
// Date : 16:25 2024/5/31
func (rc *requestConfig) initDefaultConfig(reqConfig *define.Request) {
if nil == reqConfig.RetryRule {
reqConfig.RetryRule = &define.RequestRetryRule{
RetryCount: 0,
RetryTimeInterval: 0,
RetryHttpCodeList: make([]int64, 0),
RetryBusinessCodeList: make([]string, 0),
}
}
if nil == reqConfig.Header {
reqConfig.Header = map[string]string{}
}