Propagated database clone settings to new connections.
This commit is contained in:
parent
0bd58e0efb
commit
e8b49d4cc4
|
@ -233,7 +233,11 @@ def _init_worker(counter):
|
|||
for alias in connections:
|
||||
connection = connections[alias]
|
||||
settings_dict = connection.creation.get_test_db_clone_settings(_worker_id)
|
||||
connection.settings_dict = settings_dict
|
||||
# connection.settings_dict must be updated in place for changes to be
|
||||
# reflected in django.db.connections. If the following line assigned
|
||||
# connection.settings_dict = settings_dict, new threads would connect
|
||||
# to the default database instead of the appropriate clone.
|
||||
connection.settings_dict.update(settings_dict)
|
||||
connection.close()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue