diff --git a/apps/push/models.py b/apps/push/models.py index 58dafb3950..007277319c 100644 --- a/apps/push/models.py +++ b/apps/push/models.py @@ -12,7 +12,7 @@ from apps.push import signals from apps.rss_feeds.models import Feed from utils import log as logging -from utils.feed_functions import timelimit +from utils.feed_functions import timelimit, TimeoutError DEFAULT_LEASE_SECONDS = (10 * 24 * 60 * 60) # 10 days @@ -155,9 +155,14 @@ def check_urls_against_pushed_data(self, parsed): unicode(self.feed)[:30], hub_url, self_url)) expiration_time = self.lease_expires - datetime.now() seconds = expiration_time.days*86400 + expiration_time.seconds - PushSubscription.objects.subscribe( - self_url, feed=self.feed, hub=hub_url, - lease_seconds=seconds) + try: + PushSubscription.objects.subscribe( + self_url, feed=self.feed, hub=hub_url, + lease_seconds=seconds) + except TimeoutError, e: + logging.debug(u' ---> [%-30s] ~FR~BKTimed out updating PuSH hub/topic: %s / %s' % ( + unicode(self.feed)[:30], hub_url, self_url)) + def __unicode__(self): if self.verified: diff --git a/apps/rss_feeds/page_importer.py b/apps/rss_feeds/page_importer.py index 2ca24091d8..9d126b5c46 100644 --- a/apps/rss_feeds/page_importer.py +++ b/apps/rss_feeds/page_importer.py @@ -173,7 +173,7 @@ def _fetch_story(self): response.connection.close() except requests.exceptions.TooManyRedirects: response = requests.get(story_permalink) - except (AttributeError, SocketError, OpenSSLError, PyAsn1Error), e: + except (AttributeError, SocketError, OpenSSLError, PyAsn1Error, requests.exceptions.ConnectionError), e: logging.debug(' ***> [%-30s] Original story fetch failed using requests: %s' % (self.feed, e)) return try: