pub
pub copied to clipboard
would like a re-try count on pub get, pub upgrade
CI systems can occasionally fail based on transient network issues - we see this as flaky pub get failures on bots. It'd be nice to have a feature where pub get could retry a set number of times if there are network issues. So, something like:
pub get --retry-times=5
https://github.com/dart-lang/pub/blob/980fc947db32bca6ae7d07fbb4ad0fcdba0050ec/lib/src/http.dart#L224-L232
Already have it hard-wired to 5. I guess you could ask for making that parameterized to support a different value.
Ah, ok, I wasn't aware. I probably would have just passed in 5 on the CLI. It looks like we must have hit a persistent outage (of a few minutes) for our particular CI run.
Hmm, the argument against an option is that:
- it's not needed since we already retry,
- setting to a large number won't do you much good :)
@jonasfj should we close this?
There is a environment variable: "PUB_MAX_HTTP_RETRIES" you can set, although this is not documented anywhere.
https://github.com/dart-lang/pub/blob/a3689f03168c896dd1cb0db8a60c568b38ee16bf/lib/src/http.dart#L355