Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip early when downloading existing file #650

Merged
merged 1 commit into from
May 28, 2024

Conversation

ChlodAlejandro
Copy link
Contributor

#614 moved some skip checks to until after response headers have been received, which drastically slows down the download process if the file already exists or the file has an equal checksum.

Since whether existing files (--ignore-existing) or matching checksums (--checksum) are to be skipped, file name, and checksum are all already known prior to needing information about the file through the Last-Modified header, these checks should remain at the start to avoid having to make a request which would eventually be discarded anyway. This speeds up ia download by skipping the (relatively long-running) blocking HTTP request and also stops the script from making numerous wasted requests to the Internet Archive, especially for runs which cover hundreds of files.

jjjake#614 moved skip checks to until after response headers have been
received, which drastically slows down the download process if
the file already exists or the file has an equal checksum. Since
the file name and checksum are already known prior to download,
these checks should remain at the start to avoid having to make
a request which would eventually be discarded anyway.
@jjjake
Copy link
Owner

jjjake commented May 28, 2024

Looks good, thank you @ChlodAlejandro!

@jjjake jjjake merged commit c97ec24 into jjjake:master May 28, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants