Permalink
Browse files

[djangoproject.com] Add a timeout to feed fetcher.

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@7894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 36e1a63 commit 124385bd97880c6c1364457954546abadedb2e9e jacob committed Jul 11, 2008
Showing with 2 additions and 1 deletion.
  1. +2 −1 django_website/apps/aggregator/bin/update_feeds.py
View
3 django_website/apps/aggregator/bin/update_feeds.py
@@ -6,12 +6,12 @@
import os
import sys
import time
+import socket
import optparse
import datetime
import feedparser
LOCKFILE = "/tmp/update_feeds.lock"
-
def update_feeds(verbose=False):
from django_website.apps.aggregator.models import Feed, FeedItem
for feed in Feed.objects.filter(is_defunct=False):
@@ -54,6 +54,7 @@ def update_feeds(verbose=False):
feed.feeditem_set.create(title=title, link=link, summary=content, guid=guid, date_modified=date_modified)
def main(argv):
+ socket.setdefaulttimeout(15)
parser = optparse.OptionParser()
parser.add_option('--settings')
parser.add_option('-v', '--verbose', action="store_true")

0 comments on commit 124385b

Please sign in to comment.