Permalink
Browse files

Set feed update timeouts in a more modern way.

  • Loading branch information...
1 parent 338fa65 commit 10a0d12f39760d2c2d57f66bc445f0cb87cde69f @jacobian jacobian committed Jun 27, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 django_website/aggregator/management/commands/mark_defunct_feeds.py
View
3 django_website/aggregator/management/commands/mark_defunct_feeds.py
@@ -10,8 +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)
+ r = urllib2.urlopen(f.feed_url, timeout=15)
except urllib2.HTTPError, e:
if e.code == 404 or e.code == 500:
if verbose:

0 comments on commit 10a0d12

Please sign in to comment.