Skip to content

Commit

Permalink
Rename and document that DANDI_DOWNLOAD_AGGRESSIVE_RETRY "option"
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Oct 24, 2024
1 parent f52a363 commit a9226f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dandi/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):

Check warning on line 753 in dandi/download.py

View check run for this annotation

Codecov / codecov/patch

dandi/download.py#L752-L753

Added lines #L752 - L753 were not covered by tests
# in such a case if we downloaded a little more --
# consider it a successful attempt
if downloaded_in_attempt > 0:
Expand Down

0 comments on commit a9226f0

Please sign in to comment.