MCPcopy Create free account
hub / github.com/The-Pocket/PocketFlow-Go / SetRetry

Method SetRetry

pocketflow.go:216–226  ·  view source on GitHub ↗

SetRetry configures retry behaviour.

(maxRetries int, waitMilliseconds time.Duration)

Source from the content-addressed store, hash-verified

214
215// SetRetry configures retry behaviour.
216func (n *Node) SetRetry(maxRetries int, waitMilliseconds time.Duration) *Node {
217 if maxRetries < 1 {
218 panic("maxRetries must be at least 1")
219 }
220 if waitMilliseconds < 0 {
221 panic("waitMilliseconds cannot be negative")
222 }
223 n.MaxRetries = maxRetries
224 n.WaitMilliseconds = waitMilliseconds
225 return n
226}
227
228// SetPrep sets the PrepFunc.
229func (n *Node) SetPrep(f func(ctx *PfContext, params map[string]any) (any, error)) *Node {

Calls

no outgoing calls