Skip to content

Commit

Permalink
Be more resilient on HTTP errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed May 14, 2010
1 parent a767904 commit 33d3ad2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions planet/spider.py
Expand Up @@ -125,7 +125,7 @@ def writeCache(feed_uri, feed_info, data):
log.info("Updating feed %s", feed_uri)

# if read failed, retain cached information
if not data.version and feed_info.version:
if not data.has_key('version') and feed_info.has_key('version'):
data.feed = feed_info.feed
data.bozo = feed_info.feed.get('planet_bozo','true') == 'true'
data.version = feed_info.feed.get('planet_format')
Expand All @@ -147,7 +147,7 @@ def writeCache(feed_uri, feed_info, data):
data.feed['planet_content_hash'] = data.headers['-content-hash']

# capture feed and data from the planet configuration file
if data.version:
if data.has_key('version') and data.version:
if not data.feed.has_key('links'): data.feed['links'] = list()
feedtype = 'application/atom+xml'
if data.version.startswith('rss'): feedtype = 'application/rss+xml'
Expand Down

0 comments on commit 33d3ad2

Please sign in to comment.