def _init_worker(counter):
 global _worker_id
 with counter.get_lock():
  counter.value += 1
  _worker_id = counter.value
 for alias in connections:
  connection = connections[alias]
  settings_dict = connection.creation.get_test_db_clone_settings(_worker_id)
  connection.settings_dict.update(settings_dict)
  connection.close()

def _init_worker ( counter ) : global _worker_id with counter . get_lock ( ) : counter . value += 1 _worker_id = counter . value for alias in connections : connection = connections [ alias ] settings_dict = connection . creation . get_test_db_clone_settings ( _worker_id ) connection . settings_dict . update ( settings_dict ) connection . close ( )
switch to databases dedicated to this worker .