Skip to content

Commit

Permalink
Merge pull request django#16 from PaulMcMillan/patch-1
Browse files Browse the repository at this point in the history
add a timeout so we don't get stuck on urls that behave badly.
  • Loading branch information
jezdez committed Jun 21, 2011
2 parents d1065f5 + 2e5fe6f commit 6719c75
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -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:
Expand Down

0 comments on commit 6719c75

Please sign in to comment.