Skip to content

Commit

Permalink
version1.1.5: 支持自定义运行参数RuntimeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
maguoxin committed Jun 12, 2024
1 parent 6d5ffed commit b8d2963
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,31 @@ func (client *Client) BuildRuntimeOptions (runtimeOptions *util.RuntimeOptions)
return _result
}

_result = &util.RuntimeOptions{}
if tea.BoolValue(util.IsUnset(runtimeOptions.ReadTimeout)) {
runtimeOptions.ReadTimeout = tea.Int(10000)
}

if tea.BoolValue(util.IsUnset(runtimeOptions.ConnectTimeout)) {
runtimeOptions.ConnectTimeout = tea.Int(5000)
}

if tea.BoolValue(util.IsUnset(runtimeOptions.MaxIdleConns)) {
runtimeOptions.MaxIdleConns = tea.Int(50)
}

if tea.BoolValue(util.IsUnset(runtimeOptions.MaxAttempts)) {
runtimeOptions.MaxAttempts = tea.Int(5)
}

if tea.BoolValue(util.IsUnset(runtimeOptions.BackoffPolicy)) {
runtimeOptions.BackoffPolicy = tea.String("no")
}

if tea.BoolValue(util.IsUnset(runtimeOptions.BackoffPeriod)) {
runtimeOptions.BackoffPeriod = tea.Int(1)
}

_result = runtimeOptions
return _result
}

0 comments on commit b8d2963

Please sign in to comment.