mirror of
https://github.com/ansible/awx.git
synced 2026-05-21 07:47:44 -02:30
Moved role rebuild batching down into sim rebuild code so we can call it directly
This commit is contained in:
@@ -121,14 +121,6 @@ class Role(CommonModelNameNotUnique):
|
|||||||
|
|
||||||
Note that this method relies on any parents' ancestor list being correct.
|
Note that this method relies on any parents' ancestor list being correct.
|
||||||
'''
|
'''
|
||||||
global tls
|
|
||||||
batch_role_rebuilding = getattr(tls, 'batch_role_rebuilding', False)
|
|
||||||
|
|
||||||
if batch_role_rebuilding:
|
|
||||||
roles_needing_rebuilding = getattr(tls, 'roles_needing_rebuilding')
|
|
||||||
roles_needing_rebuilding.add(self.id)
|
|
||||||
return
|
|
||||||
|
|
||||||
Role._simultaneous_ancestry_rebuild([self.id])
|
Role._simultaneous_ancestry_rebuild([self.id])
|
||||||
|
|
||||||
|
|
||||||
@@ -216,6 +208,15 @@ class Role(CommonModelNameNotUnique):
|
|||||||
if len(role_ids_to_rebuild) == 0:
|
if len(role_ids_to_rebuild) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
global tls
|
||||||
|
batch_role_rebuilding = getattr(tls, 'batch_role_rebuilding', False)
|
||||||
|
|
||||||
|
if batch_role_rebuilding:
|
||||||
|
roles_needing_rebuilding = getattr(tls, 'roles_needing_rebuilding')
|
||||||
|
roles_needing_rebuilding.update(set(role_ids_to_rebuild))
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
loop_ct = 0
|
loop_ct = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user