Add a safety feature that if a site isn't found, auto-allocate its bin.

This commit is contained in:
Herbert Wolverson 2024-03-01 14:17:59 -06:00
parent e9530dff54
commit 7836dbc3bb

View File

@ -759,9 +759,14 @@ def refreshShapers():
'children': {} 'children': {}
} }
for node in network: for node in network:
found = False
for bin in range(queuesAvailable): for bin in range(queuesAvailable):
if node in bins[bin]: if node in bins[bin]:
binnedNetwork["CpueQueue" + str(bin)]['children'][node] = network[node] binnedNetwork["CpueQueue" + str(bin)]['children'][node] = network[node]
found = True
if found == False:
newQueueId = queuesAvailable-1
binnedNetwork["CpueQueue" + str(newQueueId)]['children'][node] = network[node]
#print("Binned network = ", binnedNetwork) #print("Binned network = ", binnedNetwork)
network = binnedNetwork network = binnedNetwork