From 47a85ddd70a10636810935ea2095dd0f1d87c46d Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Mon, 1 May 2017 10:49:53 +0200 Subject: [PATCH] Add FimfarchiveFetcher timeout to prevent lockups --- fimfarchive/fetchers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fimfarchive/fetchers.py b/fimfarchive/fetchers.py index fd2d8fb..2dcb242 100644 --- a/fimfarchive/fetchers.py +++ b/fimfarchive/fetchers.py @@ -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: