Skip to content

Commit

Permalink
chore: Document noqa usage. Set timeout (time before and between bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 15, 2024
1 parent bf28247 commit bc698f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def download_data_source(object_id, model=None, lang_code="en"):

datasource.files.add(*files)
else:
r = requests.get(datasource.urls[0], stream=True) # noqa: S113
r = requests.get(datasource.urls[0], stream=True, timeout=10)
if r.status_code != 200:
logger.error(
"Error while downloading data file for %s",
Expand Down Expand Up @@ -355,7 +355,7 @@ def download_data_source(object_id, model=None, lang_code="en"):
datasource.analyzed_file.name = path
datasource.save()
else:
r = requests.get(datasource.analyzed_data_url, stream=True) # noqa: S113
r = requests.get(datasource.analyzed_data_url, stream=True, timeout=10)
if r.status_code != 200:
logger.error(
"Error while downloading data file for %s",
Expand Down
2 changes: 1 addition & 1 deletion spoonbill_web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = not production

ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0"] # noqa: S104
ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0"] # noqa: S104 # Docker
if "ALLOWED_HOSTS" in os.environ:
ALLOWED_HOSTS.extend(os.getenv("ALLOWED_HOSTS").split(","))

Expand Down

0 comments on commit bc698f3

Please sign in to comment.