mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-05 18:34:52 +00:00
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.
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user