-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from dateutil/ci_issues
Retry logic for travis and appveyor
- Loading branch information
Showing
4 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo off | ||
REM This script takes a command and retries it a few times if it fails, with a | ||
REM timeout between each retry. | ||
|
||
setlocal EnableDelayedExpansion | ||
|
||
REM Loop at most n_retries times, waiting sleep_time times between | ||
set sleep_time=60 | ||
set n_retries=5 | ||
|
||
for /l %%x in (1, 1, %n_retries%) do ( | ||
call %* | ||
if not ERRORLEVEL 1 EXIT /B 0 | ||
timeout /t %sleep_time% /nobreak > nul | ||
) | ||
|
||
REM If it failed all n_retries times, we can give up at last. | ||
EXIT /B 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
sleep_time=60 | ||
n_retries=5 | ||
|
||
for i in `seq 1 $n_retries`; do | ||
"$@" && exit 0 | ||
sleep $sleep_time | ||
done | ||
|
||
exit 1 |