In 2020 AI direction may fire and easy to use tool

tools

tenacity

  • python retry module: ftp reconnection e.g.
  • pip install tenacity
import random
from tenacity import retry

@retry
def do_something_unreliable():
    if random.randint(0, 10) > 1:
        raise IOError("Broken sauce, everything is hosed!!!111one")
    else:
        return "Awesome sauce!"

print(do_something_unreliable())

Guess you like

Origin blog.csdn.net/weixin_32393347/article/details/104281669