diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-07-13 17:34:19 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-07-13 17:34:19 +0200 |
commit | 0f13491e86cc0a52c974baccea4fca176d7d1a69 (patch) | |
tree | dfc6495ba71a475d6f023594554c63910ab01395 | |
parent | It is useless to retrieve all articles in order to count the number of articles. (diff) | |
download | newspipe-0f13491e86cc0a52c974baccea4fca176d7d1a69.tar.gz newspipe-0f13491e86cc0a52c974baccea4fca176d7d1a69.tar.bz2 newspipe-0f13491e86cc0a52c974baccea4fca176d7d1a69.zip |
Timeout of 5 seconds for all sockets.
-rw-r--r-- | pyaggr3g470r/crawler.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pyaggr3g470r/crawler.py b/pyaggr3g470r/crawler.py index af0597a1..48ee22d2 100644 --- a/pyaggr3g470r/crawler.py +++ b/pyaggr3g470r/crawler.py @@ -27,6 +27,7 @@ __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "AGPLv3" import re +import socket import logging import feedparser import urllib2 @@ -35,7 +36,7 @@ import dateutil.parser from bs4 import BeautifulSoup from datetime import datetime from sqlalchemy.exc import IntegrityError -#from requests.exceptions import * +from requests.exceptions import * import gevent.monkey gevent.monkey.patch_all() @@ -53,6 +54,7 @@ if not conf.ON_HEROKU: logger = logging.getLogger(__name__) +socket.setdefaulttimeout(5.0) class TooLong(Exception): def __init__(self): |