home · contact · privacy
Fix page reading timeouts.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 18 Apr 2016 20:55:03 +0000 (22:55 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 18 Apr 2016 20:55:03 +0000 (22:55 +0200)
plomlombot.py

index aa7061cac656f3f6b5f768e40787ccb6fbc475c4..ede4dca9b1dccc6b55861062daea277df26ba415 100755 (executable)
@@ -339,7 +339,7 @@ def handle_url(url, notice, show_url=False):
             return True
 
     try:
-        r = requests.get(url, timeout=5, stream=True)
+        r = requests.get(url, timeout=15, stream=True)
         r.raw.decode_content = True
         text = r.raw.read(10000000+1)
         if len(text) > 10000000:
@@ -347,6 +347,7 @@ def handle_url(url, notice, show_url=False):
     except (requests.exceptions.TooManyRedirects,
             requests.exceptions.ConnectionError,
             requests.exceptions.InvalidURL,
+            requests.exceptions.ReadTimeout,
             UnicodeError,
             ValueError,
             requests.exceptions.InvalidSchema) as error: