Skip to content

Commit

Permalink
refactor: no need to send a head request if cache hits
Browse files Browse the repository at this point in the history
  • Loading branch information
coolkiid committed Oct 14, 2024
1 parent 03e4ec8 commit da1028f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/fetchers/http_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ async def download(self, item: str, root_dir: str, override_exist: bool):
shutil.copy2(cache, file_path)
skip_download = True

header = await self._send_head_request(item)
header = {}
if not skip_download:
header = await self._send_head_request(item)
partial = _check_range_supported(header)
size = _get_content_length(header)

Expand Down

0 comments on commit da1028f

Please # to comment.