diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 293586ae3..80bdd3d0c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -85,6 +85,10 @@ development command line options. function will patch `requests` to log the results of calls to `requests.utils.super_len()` +- `DANDI_DOWNLOAD_AGGRESSIVE_RETRY` -- When set, would make `download()` retry + very aggressively - it would keep trying if at least some bytes are downloaded + on each attempt. Typically is not needed and could be a sign of network issues. + ## Sourcegraph The [Sourcegraph](https://sourcegraph.com) browser extension can be used to diff --git a/dandi/download.py b/dandi/download.py index 2295c017f..249732e1b 100644 --- a/dandi/download.py +++ b/dandi/download.py @@ -750,7 +750,7 @@ def _download_file( # errors (among others) in addition to HTTP status errors. except requests.RequestException as exc: sleep_amount = random.random() * 5 * attempt - if os.environ.get("DANDI_DEVEL_AGGRESSIVE_RETRY"): + if os.environ.get("DANDI_DOWNLOAD_AGGRESSIVE_RETRY"): # in such a case if we downloaded a little more -- # consider it a successful attempt if downloaded_in_attempt > 0: