Pyramid的执行策略,支持在特定失败异常后重试请求。
项目描述
pyramid_retry 是一种Pyramid的执行策略,它包装请求并在某些“可重试”错误条件下重试请求,在向客户端指示失败之前可以配置重试次数。
有关详细信息,请参阅 https://docs.pylonsproject.org/projects/pyramid-retry/en/latest/ 或此分发的 docs/index.rst。
2.1.1 (2020-03-21)
如果 activate_hook 抛出错误或由于客户端断开连接而无法读取请求体,请确保正确弹出 threadlocals。请参阅 https://github.com/Pylons/pyramid_retry/pull/20
2.1 (2019-09-30)
向 pyramid_retry.IBeforeRetry 事件添加 exception 和 response 属性。请参阅 https://github.com/Pylons/pyramid_retry/pull/19
2.0 (2019-06-06)
当策略捕获到异常时,不再调用 invoke_exception_view。如果是在最后一次尝试或不可重试的情况下,异常现在将冒泡出应用程序并进入WSGI中间件。请参阅 https://github.com/Pylons/pyramid_retry/pull/17
1.0 (2018-10-18)
支持Python 3.7。
将我们要求的Pyramid版本更新为非预发布版,这样pip和其他工具就不会意外安装预发布软件。请参阅 https://github.com/Pylons/pyramid_retry/pull/13
0.5 (2017-06-19)
更新策略以跟踪Pyramid 1.9b1的变化。这是一个不兼容的更改,需要至少Pyramid 1.9b1。请参阅 https://github.com/Pylons/pyramid_retry/pull/11
0.4 (2017-06-12)
添加了 mark_error_retryable 函数,以便轻松地将某些错误标记为可重试,以便 pyramid_retry 能够检测。请参阅 https://github.com/Pylons/pyramid_retry/pull/8
添加了 IBeforeRetry 事件,可以在即将发生重试时订阅以通知进行对 environ 的清理。请参阅 https://github.com/Pylons/pyramid_retry/pull/9
0.3 (2017-04-10)
支持 retry.activate_hook 设置,该设置可以返回每个请求的重试次数。请参阅 https://github.com/Pylons/pyramid_retry/pull/4
配置被延迟,这样可以在调用 config.include('pyramid_retry') 之后更改设置,直到配置器被提交。请参阅 https://github.com/Pylons/pyramid_retry/pull/4
将视图谓词重命名为 last_retry_attempt 和 retryable_error。请参阅 https://github.com/Pylons/pyramid_retry/pull/3
将 pyramid_retry.is_exc_retryable 重命名为 pyramid_retry.is_error_retryable。请参阅 https://github.com/Pylons/pyramid_retry/pull/3
0.2 (2017-03-02)
将默认尝试次数更改为3而不是1。
将视图谓词重命名为 is_last_attempt 和 is_exc_retryable。
取消对 tm.attempts 设置的支持。
现在始终在 registry.settings['retry.attempts'] 中设置 retry.attempts 设置,以便应用程序可以检查它。
0.1 (2017-03-01)
初始发布。