Skip to content

Commit

Permalink
Avoid error when remote file is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yumorishita committed Dec 25, 2020
1 parent e409224 commit fae0078
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions LiCSBAS_lib/LiCSBAS_tools_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
=========
Changelog
=========
v1.6.2 20201225 Yu Morishita, GSI
- Avoid error when remote file is empty
v1.6.1 20201207 Yu Morishita, GSI
- Check size and retry if error in download_data
v1.6 20200911 Yu Morishita, GSI
Expand Down Expand Up @@ -67,6 +69,9 @@ def comp_size_time(file_remote, file_local):

if response.status_code != 200:
return 3
elif response.headers.get("Content-Length") is None:
## Remote file exist but empty
return 3

size_remote = int(response.headers.get("Content-Length"))
size_local = os.path.getsize(file_local)
Expand Down

0 comments on commit fae0078

Please sign in to comment.