retrypy:重试函数的简单方法

时间:2021-06-25 15:18:03
【文件属性】:
文件名称:retrypy:重试函数的简单方法
文件大小:8KB
文件格式:ZIP
更新时间:2021-06-25 15:18:03
Python python重试包装器/装饰器 一种自动重试可能引发错误的函数的简单方法。 您可以直接调用重试或装饰一个函数以使其重试。 智能匹配逻辑允许您在引发其他异常的同时重试某些异常。 直接调用函数: from retrypy import retry, check def dummy_func(): print "dummy_func called..." raise Exception("House") retry.call( dummy_func, times=2 ) dummy_func called... dummy_func called... Exception: House # usign a check method retry.call( dummy_func, check = check.message_equals("foo
【文件预览】:
retrypy-master
----.travis.yml(115B)
----README.rst(6KB)
----requirements-dev.txt(40B)
----retrypy()
--------check.py(673B)
--------__init__.py(23B)
--------retry.py(3KB)
--------delay.py(908B)
----test()
--------test_check.py(1KB)
--------test_delay.py(607B)
--------test_retry.py(6KB)
----LICENSE(1KB)
----setup.py(433B)
----.gitignore(59B)
----Makefile(246B)

网友评论