Add FimfarchiveFetcher timeout to prevent lockups

This commit is contained in:
Joakim Soderlund 2017-05-01 10:49:53 +02:00
parent 7199d47395
commit 47a85ddd70

View file

@ -171,8 +171,8 @@ class FimfictionFetcher(Fetcher):
StorySourceError: If the server does not return HTTP 200 OK.
"""
try:
response = requests.get(url, params=kwargs)
except IOError as e:
response = requests.get(url, params=kwargs, timeout=60)
except OSError as e:
raise StorySourceError("Could not read from server.") from e
if not response.ok: