From 7dc9e105f9993aeb1e4cfb9ad19c5cc6f709bcfb Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 1 Jul 2013 22:47:58 +0200 Subject: [PATCH] Ensure db connection is closed before script exits This is required in django 1.4, but was closed automatically back in 1.2 when it was created. --- tools/rss/fetch_rss_feeds.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/rss/fetch_rss_feeds.py b/tools/rss/fetch_rss_feeds.py index a71760c8..40c36cf8 100755 --- a/tools/rss/fetch_rss_feeds.py +++ b/tools/rss/fetch_rss_feeds.py @@ -13,7 +13,7 @@ import settings setup_environ(settings) from core.models import ImportedRSSFeed, ImportedRSSItem -from django.db import transaction +from django.db import transaction, connection # Set timeout for loading RSS feeds socket.setdefaulttimeout(20) @@ -49,3 +49,5 @@ for importfeed in ImportedRSSFeed.objects.all(): transaction.commit() except Exception, e: print "Failed to load %s: %s" % (importfeed, e) + +connection.close() -- 2.39.5