diff --git a/doctr/travis.py b/doctr/travis.py index 0f15eca5..9181a923 100644 --- a/doctr/travis.py +++ b/doctr/travis.py @@ -544,7 +544,7 @@ def push_docs(deploy_branch='gh-pages', retries=5): """ code = 1 - while code and retries: + for i in range(retries): print("Pulling") code = run(['git', 'pull', '-s', 'recursive', '-X', 'ours', 'doctr_remote', deploy_branch], exit=False) @@ -554,10 +554,10 @@ def push_docs(deploy_branch='gh-pages', retries=5): if code: retries -= 1 print("Push failed, retrying") - time.sleep(1) + time.sleep(2**i) else: return - sys.exit("Giving up...") + sys.exit("Giving up pushing after {retries} tries :(".format(retries=retries)) def last_commit_by_doctr(): """Check whether the author of `HEAD` is `doctr` to avoid starting an