Skip to content

Commit

Permalink
Shorten timeout on payload ID list download.
Browse files Browse the repository at this point in the history
  • Loading branch information
darksidelemm committed Oct 5, 2020
1 parent 99a5dca commit c09dd9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion horusdemodlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.19"
__version__ = "0.1.20"
8 changes: 4 additions & 4 deletions horusdemodlib/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ def read_payload_list(filename="payload_id_list.txt"):
return payload_list


def download_latest_payload_id_list(url=PAYLOAD_ID_LIST_URL, filename=None):
def download_latest_payload_id_list(url=PAYLOAD_ID_LIST_URL, filename=None, timeout=5):
"""
Attempt to download the latest payload ID list from Github, and parse into a dictionary.
Optionally, save it to a file.
"""
# Download the list.
try:
logging.info("Attempting to download latest payload ID list from GitHub...")
_r = requests.get(url, timeout=10)
_r = requests.get(url, timeout=timeout)
except Exception as e:
logging.error("Unable to get latest payload ID list: %s" % str(e))
return None
Expand Down Expand Up @@ -212,13 +212,13 @@ def grab_latest_custom_field_list(url=HORUS_CUSTOM_FIELD_URL, local_file="custom
return True


def download_latest_custom_field_list(url=HORUS_CUSTOM_FIELD_URL, filename=None):
def download_latest_custom_field_list(url=HORUS_CUSTOM_FIELD_URL, filename=None, timeout=5):
""" Attempt to download the latest custom field list from Github """

# Download the list.
try:
logging.info("Attempting to download latest custom field list from GitHub...")
_r = requests.get(url, timeout=10)
_r = requests.get(url, timeout=timeout)
except Exception as e:
logging.error("Unable to get latest custom field list: %s" % str(e))
return None
Expand Down

0 comments on commit c09dd9b

Please sign in to comment.