Skip to content

Commit

Permalink
Update feed status information on network errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
passiomatic committed Aug 16, 2015
1 parent ec1f1c4 commit 97137be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion coldsweat/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def __init__(self, feed):
_, self.netloc, _, _, _ = urlparse.urlsplit(feed.self_link)

self.feed = feed


# @@TODO
# def handle_500(self, response):
# '''
# Internal server error
# '''
# pass

def handle_404(self, response):
'''
Not Found
Expand Down Expand Up @@ -135,6 +142,7 @@ def update_feed(self):
self.feed.last_status = HTTPServiceUnavailable.code
self.feed.error_count += 1
logger.warn(u"a network error occured while fetching %s, skipped" % self.netloc)
self.feed.save()
return

self.feed.last_checked_on = self.instant
Expand Down

0 comments on commit 97137be

Please sign in to comment.