mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Speed up integrationUISP.py
* Adds one more "is not none" check for a line that failed on my installation. * Add a level of indentation to the inner "walkGraph" function, so it doesn't painstakingly check every node when it already knows that it won't pick them (for a route cost). My testing gave the same results, substantially faster.
This commit is contained in:
parent
c7ca4b171d
commit
df3be0b73e
@ -221,13 +221,13 @@ def walkGraphOutwards(siteList, root, routeOverrides):
|
||||
site['parent'] = parent['id']
|
||||
#print(debugSpaces(cost/10) + parent['name'] + "->" + site['name'] + " -> New cost: " + str(cost))
|
||||
|
||||
for connection in site['connections']:
|
||||
if not connection in backPath:
|
||||
#target = findInSiteListById(siteList, connection)
|
||||
#print(debugSpaces((cost+10)/10) + site['name'] + " -> " + target['name'] + " (" + str(target['cost']) + ")")
|
||||
newBackPath = backPath.copy()
|
||||
newBackPath.append(site['id'])
|
||||
walkGraph(connection, site, cost+10, newBackPath)
|
||||
for connection in site['connections']:
|
||||
if not connection in backPath:
|
||||
#target = findInSiteListById(siteList, connection)
|
||||
#print(debugSpaces((cost+10)/10) + site['name'] + " -> " + target['name'] + " (" + str(target['cost']) + ")")
|
||||
newBackPath = backPath.copy()
|
||||
newBackPath.append(site['id'])
|
||||
walkGraph(connection, site, cost+10, newBackPath)
|
||||
|
||||
for connection in root['connections']:
|
||||
# Force the parent since we're at the top
|
||||
|
Loading…
Reference in New Issue
Block a user