重试策略
源代码位于 llama-index-core/llama_index/core/workflow/retry_policy.py
next #
决定是否应进行另一次重试,返回下次运行前等待的秒数。
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
参数
next(elapsed_time: float, attempts: int, error: Exception) -> Optional[float]
名称
类型
描述 | 默认值 | elapsed_time | float |
---|---|---|---|
自上次尝试以来经过的时间(秒)。
|
必需
|
attempts |
int |
到目前为止已进行的尝试次数。
|
error
|
Exception |
int |
发生的最后一个错误。
|
返回值
|
可选[float] |
int |
下次尝试前等待的秒数,如果停止重试则为 None。
默认值 | elapsed_time |
---|---|
ConstantDelayRetryPolicy #
|
一种简单的策略,按固定间隔重试步骤多次。 |
决定是否应进行另一次重试,返回下次运行前等待的秒数。
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
返回顶部
决定是否应进行另一次重试,返回下次运行前等待的秒数。
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|