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

Method SetRetry

pocketflow.go:376–386  ·  view source on GitHub ↗

SetRetry configures retry behaviour.

(maxRetries int, waitMilliseconds time.Duration)

Source from the content-addressed store, hash-verified

374
375// SetRetry configures retry behaviour.
376func (bn *BatchNode) SetRetry(maxRetries int, waitMilliseconds time.Duration) *BatchNode {
377 if maxRetries < 1 {
378 panic("maxRetries must be at least 1")
379 }
380 if waitMilliseconds < 0 {
381 panic("waitMilliseconds cannot be negative")
382 }
383 bn.MaxRetries = maxRetries
384 bn.WaitMilliseconds = waitMilliseconds
385 return bn
386}
387
388// SetPrep sets the PrepFunc. Expects a function returning []any.
389func (bn *BatchNode) SetPrep(f func(ctx *PfContext, params map[string]any) ([]any, error)) *BatchNode {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected