summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 2387a44..455de8d 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -266,16 +266,17 @@ class JobQueue():
print "-- ", settings.DATABASES['default']['NAME'], settings.DATABASES['default']['ENGINE']
# but because the user may be expecting to add this to a db with lots of tables already there,
- # the jobque may not start from scratch so we need to initialise the db properly first.
+ # the jobque may not start from scratch so we need to initialise the db properly first
+ # because we are using an empty :memory: database
# But initiating twice crashes, so be sure to do it once only.
if ("reinit",reinit_db) not in self.queue:
reinit_db()
if ("dirsredirect",dirsredirect) not in self.queue:
dirsredirect()
if ("caves",import_caves) not in self.queue:
- import_caves()
+ import_caves() # sometime extract the initialising code from this and put in reinit
if ("people",import_people) not in self.queue:
- import_people()
+ import_people() # sometime extract the initialising code from this and put in reinit
django.db.close_old_connections() # maybe not needed here
@@ -290,6 +291,7 @@ class JobQueue():
settings.DATABASES['default']['NAME'] = dbname
print "-- ", settings.DATABASES['default']['NAME'], settings.DATABASES['default']['ENGINE']
+ django.db.close_old_connections() # maybe not needed here
for j in self.results_order:
self.results[j].pop() # throw away results from :memory: run
self.results[j].append(None) # append a placeholder