Browse files

Merge pull request #16 from PaulMcMillan/patch-1

add a timeout so we don't get stuck on urls that behave badly.
  • Loading branch information...
2 parents d1065f5 + 2e5fe6f commit 6719c7572f9e802331b16e2ff4b637d4911c2b38 @jezdez jezdez committed Jun 21, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 django_website/aggregator/management/commands/mark_defunct_feeds.py
View
1 django_website/aggregator/management/commands/mark_defunct_feeds.py
@@ -10,6 +10,7 @@ def handle(self, *args, **kwargs):
verbose = kwargs.get('verbosity')
for f in Feed.objects.all():
try:
+ socket.setdefaulttimeout(15)
r = urllib2.urlopen(f.feed_url)
except urllib2.HTTPError, e:
if e.code == 404 or e.code == 500:

0 comments on commit 6719c75

Please sign in to comment.