Skip to content

Commit

Permalink
fetch: Set timeout
Browse files Browse the repository at this point in the history
Before we sometimes waited for ages for some feed in ca-qc.json
  • Loading branch information
jbruechert committed Nov 10, 2024
1 parent ccaf97d commit 064ebb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ def fetch_source(self, dest_path: Path, source: Source) -> bool:
return self.fetch_source(dest_path, http_source)
case HttpSource():
request_options = {
"verify": not source.options.ignore_tls_errors
"verify": not source.options.ignore_tls_errors,
"timeout": 5
}

headers = source.options.headers.copy()
if not "user-agent" in headers:
if "user-agent" not in headers:
headers["user-agent"] \
= "Transitous GTFS Fetcher (https://transitous.org)"

Expand Down

0 comments on commit 064ebb5

Please sign in to comment.