Skip to content

Commit

Permalink
Updated the list of things that might go wrong when fetching a feed...
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Jun 27, 2011
1 parent 9a68d15 commit 07ee7c1
Showing 1 changed file with 4 additions and 2 deletions.
@@ -1,5 +1,6 @@
import socket
import urllib2
import httplib
from django.core.management.base import BaseCommand
from django_website.aggregator.models import Feed

Expand All @@ -10,8 +11,9 @@ class Command(BaseCommand):
def handle(self, *args, **kwargs):
for f in Feed.objects.filter(is_defunct=False):
try:
r = urllib2.urlopen(f.feed_url, timeout=15)
except (urllib2.HTTPError, urllib2.URLError, socket.timeout), e:
urllib2.urlopen(f.feed_url, timeout=15)
except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException,
socket.timeout), e:
print "%s on '%s'; marking defunct" % (e, f)
f.is_defunct = True
f.save()

0 comments on commit 07ee7c1

Please sign in to comment.