Skip to content

Commit 93d7753

Browse files
author
Benjamin Moody
committed
dl_files: use HEAD when no content is desired.
This function requests the file index of the specified database, to check whether it exists, but does not actually read its contents. This is a waste of bandwidth and a waste of processing time on both ends. Change this to perform a HEAD request instead.
1 parent 26fc602 commit 93d7753

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wfdb/io/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def dl_files(db, dl_dir, files, keep_subdirs=True, overwrite=False):
511511
db_url = posixpath.join(PN_CONTENT_URL, db_dir) + '/'
512512

513513
# Check if the database is valid
514-
response = requests.get(db_url)
514+
response = requests.head(db_url)
515515
response.raise_for_status()
516516

517517
# Construct the urls to download

0 commit comments

Comments
 (0)