2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

more thorough reset before running :memory:

This commit is contained in:
Philip Sargent 2020-05-13 21:52:28 +01:00
parent f326bf9148
commit ac7cb45f61

View File

@ -249,7 +249,7 @@ class JobQueue():
def run(self):
self.loadprofiles()
# save db settings for later
dbengine = settings.DATABASES['default']['ENGINE']
dbname = settings.DATABASES['default']['NAME']
dbdefault = settings.DATABASES['default']
@ -265,8 +265,19 @@ class JobQueue():
# run all the imports through :memory: first
settings.DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'
settings.DATABASES['default']['NAME'] = ":memory:"
settings.DATABASES['default']['USER'] = ""
settings.DATABASES['default']['PASSWORD'] = ""
settings.DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3',
'AUTOCOMMIT': True,
'ATOMIC_REQUESTS': False,
'NAME': ':memory:',
'CONN_MAX_AGE': 0,
'TIME_ZONE': 'UTC',
'OPTIONS': {},
'HOST': '',
'USER': '',
'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None},
'PASSWORD': '',
'PORT': ''}
print "-- ", settings.DATABASES['default']['NAME'], settings.DATABASES['default']['ENGINE']
print "-- DATABASES.default", settings.DATABASES['default']