MCPcopy Create free account
hub / github.com/imroc/req / AddRetryHook

Method AddRetryHook

request.go:1209–1213  ·  view source on GitHub ↗

AddRetryHook adds a retry hook which will be executed before a retry.

(hook RetryHookFunc)

Source from the content-addressed store, hash-verified

1207
1208// AddRetryHook adds a retry hook which will be executed before a retry.
1209func (r *Request) AddRetryHook(hook RetryHookFunc) *Request {
1210 ro := r.getRetryOption()
1211 ro.RetryHooks = append(ro.RetryHooks, hook)
1212 return r
1213}
1214
1215// SetRetryCondition sets the retry condition, which determines whether the
1216// request should retry.

Callers 2

TestAddRetryHookFunction · 0.80
AddRetryHookFunction · 0.80

Calls 1

getRetryOptionMethod · 0.95

Tested by 1

TestAddRetryHookFunction · 0.64