Skip to content

Commit

Permalink
fix: Make sure requests to jvndb timeout relatively fast
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Dec 17, 2024
1 parent 814801a commit c669123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vulnerabilitylookup/feeders/jvndb.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def _fetch_feeds(self) -> list[Path]:
for year in range(2002, datetime.now().year + 1):
to_fetch = base_url.format(year=year)
with (self.files_storage / f'jvndb_{year}.rdf').open('w') as f:
response = requests.get(to_fetch)
response = requests.get(to_fetch, timeout=15)
f.write(response.text)
all_files.append(self.files_storage / f'jvndb_{year}.rdf')

# NOTE: this file must always be the last one in the list.
with (self.files_storage / 'jvndb_updates.rdf').open('w') as f:
response = requests.get('https://jvndb.jvn.jp/en/rss/jvndb.rdf')
response = requests.get('https://jvndb.jvn.jp/en/rss/jvndb.rdf', timeout=15)
f.write(response.text)
all_files.append(self.files_storage / 'jvndb_updates.rdf')
return all_files
Expand Down

0 comments on commit c669123

Please sign in to comment.