Skip to content

Commit

Permalink
Merge pull request #117 from pgierz/master
Browse files Browse the repository at this point in the history
Adds timeout to download
  • Loading branch information
brian-rose committed Nov 15, 2019
2 parents f2a8ed1 + 924ec9f commit a8b6286
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion climlab/utils/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def merge_two_dicts(x, y):

def _download_and_cache(source, local_path):
import requests
resp = requests.get(source, allow_redirects=True)
resp = requests.get(source, allow_redirects=True, timeout=300)
if resp.status_code == 200: # successful http request
with open(local_path, 'wb') as file:
file.write(resp.content)
Expand Down

0 comments on commit a8b6286

Please sign in to comment.