Small changes that are trying to root out the un-updateable feed problem.

This commit is contained in:
Samuel Clay 2010-10-07 19:07:43 -04:00
parent 103b90fd01
commit c2e1e82464
3 changed files with 9 additions and 14 deletions

View file

@ -75,16 +75,10 @@ class Feed(models.Model):
try:
if lock:
lock.acquire()
try:
super(Feed, self).save(*args, **kwargs)
finally:
lock.release()
else:
super(Feed, self).save(*args, **kwargs)
super(Feed, self).save(*args, **kwargs)
except IntegrityError:
# Feed has been deleted. Just ignore it.
logging.debug(' ***> [%-30s] Feed deleted. Could not save.' % self)
pass
def update_all_statistics(self, lock=None):

View file

@ -1054,6 +1054,9 @@
this.switch_taskbar_view(this.story_view);
// NEWSBLUR.log(['open_feed', this.flags, this.active_feed, feed_id]);
_.defer(_.bind(function() {
this.model.load_feed(feed_id, 0, true, $.rescope(this.post_open_feed, this));
}, this));
var feed_view_setting = this.model.view_setting(feed_id);
if (!feed_view_setting || feed_view_setting == 'page') {
_.defer(_.bind(function() {
@ -1063,9 +1066,6 @@
this.unload_iframe();
this.flags['iframe_prevented_from_loading'] = true;
}
_.defer(_.bind(function() {
this.model.load_feed(feed_id, 0, true, $.rescope(this.post_open_feed, this));
}, this));
this.flags['opening_feed'] = false;
var $iframe_contents = this.$s.$story_iframe.contents();
$iframe_contents

View file

@ -47,7 +47,8 @@ class FetchFeed:
@timelimit(20)
def fetch(self):
""" Downloads and parses a feed.
"""
Uses feedparser to download the feed. Will be parsed later.
"""
socket.setdefaulttimeout(30)
identity = self.get_identity()
@ -145,7 +146,7 @@ class ProcessFeed:
if self.fpf.bozo and isinstance(self.fpf.bozo_exception, feedparser.NonXMLContentType):
if not self.fpf.entries:
logging.debug(" ---> [%-30s] Feed is Non-XML. Checking address..." % unicode(self.feed)[:30])
logging.debug(" ---> [%-30s] Feed is Non-XML. %s entries. Checking address..." % (unicode(self.feed)[:30]), len(self.fpf.entries))
fixed_feed = self.feed.check_feed_address_for_feed_link()
if not fixed_feed:
self.feed.save_feed_history(502, 'Non-xml feed', self.fpf.bozo_exception)
@ -154,7 +155,7 @@ class ProcessFeed:
self.feed.save()
return FEED_ERRPARSE, ret_values
elif self.fpf.bozo and isinstance(self.fpf.bozo_exception, xml.sax._exceptions.SAXException):
logging.debug(" ---> [%-30s] Feed is Bad XML (SAX). Checking address..." % unicode(self.feed)[:30])
logging.debug(" ---> [%-30s] Feed is Bad XML (SAX). %s entries. Checking address..." % (unicode(self.feed)[:30]), len(self.fpf.entries))
if not self.fpf.entries:
fixed_feed = self.feed.check_feed_address_for_feed_link()
if not fixed_feed: