Retry when pub fails in flutter tool. (#12069)
This ports the five-second retry interval from flutter.bat to the Bash version. Failures during "pub get" of the flutter tool are common on Travis and so this should help Travis reliability if nothing else.
This commit is contained in:
parent
ba36008af6
commit
8079b1fbca
@ -87,7 +87,12 @@ FLUTTER_TOOL_ARGS="--assert-initializer $FLUTTER_TOOL_ARGS"
|
||||
LOCAL_PUB_ENV="$LOCAL_PUB_ENV:flutter_bot"
|
||||
fi
|
||||
LOCAL_PUB_ENV="$LOCAL_PUB_ENV:flutter_install"
|
||||
(cd "$FLUTTER_TOOLS_DIR"; PUB_ENVIRONMENT=$LOCAL_PUB_ENV "$PUB" upgrade --verbosity=error --no-packages-dir)
|
||||
while : ; do
|
||||
cd "$FLUTTER_TOOLS_DIR"
|
||||
PUB_ENVIRONMENT="$LOCAL_PUB_ENV" "$PUB" upgrade --verbosity=error --no-packages-dir && break
|
||||
echo Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...
|
||||
sleep 5
|
||||
done
|
||||
"$DART" --snapshot="$SNAPSHOT_PATH" --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH"
|
||||
echo $REVISION > "$STAMP_PATH"
|
||||
fi
|
||||
|
@ -108,7 +108,7 @@ GOTO :after_subroutine
|
||||
:retry_pub_upgrade
|
||||
CALL "%pub%" upgrade --verbosity=error --no-packages-dir
|
||||
IF "%ERRORLEVEL%" NEQ "0" (
|
||||
ECHO Error: Unable to 'pub upgrade' flutter tool. Retrying...
|
||||
ECHO Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds...
|
||||
timeout /t 5 /nobreak
|
||||
GOTO :retry_pub_upgrade
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user